Panel Interface Board  1
inszt_man.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:26:37 2020
5 */
6 /**************************************************************************************/
29 /**************************************************************************************/
30 /**************************************************************************************/
31 /**************************************************************************************/
32 /* Section: Included Files */
33 /**************************************************************************************/
34 /**************************************************************************************/
35 #define QQQdialect MPLABX
36 #undef QQQ146
37 #undef QQQ148
38 #undef QQQbndchk
39 #undef QQQ294
40 #undef QQQEMBEDDEDICE
41  /* Note: for BITMAP execution histories QQQthreaded is not defined */
42 #undef QQQthreaded
43 #undef QQQdo178b
44 #undef QQQfixbra
45 #define QQQswitch3
46 #undef QQQternary
47 #define QQQswitch
48 #undef QQQmacrof
49 #undef QQQMULTIPROCESSEXH
50 #undef QQFLUSH
51 #undef QQNEWBS
52 #define qqqMaxBranchDepth 20
53 #define QQQstructbitmap
54  static int qqqqbmselwidth = 32 ;
55  static int zzfileid = 59;
56 #define QQQnumfil 23
57 #undef QQQALGONE
58 #undef QQQVCLFLG
59 #undef QQQFORKFL
60 #undef QQQIADDRF
61 #undef QQQRTI
62 #undef QQQPERFA
63 #undef QQQADRMOD
64 #undef QQQDCAPFL
65 #undef QQQTEMPLATEONLY
66 #define QQQNOATEXIT
67 #define QQQUPLOADATEND
68 #define QQQNOSTDIO
69 #undef QQQASHLINGVITRA
70 #define QQQBITMAP
71  #define qqqbitmapint unsigned int
72 #undef QQQBITMAPMCDC
73 #undef QQQTIC2XSERIALIO
74 #undef QQQTIC2XFLASH
75 #undef QQQCOMPRESSED_EXH
76 #undef QQQMAINFL
77 #define QQQSINGLEFILE
78 #define QQQFILEID
79 #define QQQseparate
80 extern int QQQindicator;
81 static int QQQfirstmcdc=1;
82 #define man_59zzopen zzopen
83  extern int man_59zzopen ;
84 #define man_59zqqzqz1 zqqzqz1
85 #define QQQLDRA_PORT
86 #ifndef QQQLDRA_PORT
87 #define FILEPOINT FILE * f,
88 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
89 #include <stdio.h>
90  /* ----------------------------------------------------------------------* 100 *
91  * If stdio.h is not available then insert:
92  * typedef int * FILE;
93  * -----------------------------------------------------------------------------
94  */
95 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
96 #else /* QQQLDRA_PORT */
97 #define FILEPOINT
98 /*************************** LDRA_PORT *********************************/
99 #ifdef QQQ_SHLAYOUT
100 static int tbrun_mode=1;
101 #else
102 static int tbrun_mode=0;
103 #endif /* QQQ_SHLAYOUT */
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
105 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
106 #ifndef QQQ_SHLAYOUT
107 #ifdef QQQMAINFL
108 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
109 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
110 #endif /* QQQMAINFL */
111 #endif /* QQQ_SHLAYOUT */
112 /************************ END OF LDRA_PORT *****************************/
113 #endif /* QQQLDRA_PORT */
114 #ifndef QQQnumfil
115 #define QQQnumfil 40 /* default setting */
116 #endif /* QQQnumfil */
117 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
118 #ifndef LDRA_VOID_FUNC
119 #define LDRA_VOID_FUNC
120  typedef void(*ldra_void_function)();
121 #endif
122 #if defined(QQQMAINFL)
123  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
124  through the target you would have to set this to 0 before calling the qqqupload.
125  Move this into ldra_port mechanism. */
126  int qqqshell_upload = 0;
127  int QQQfcn_ptr_num = 0;
128  static int qqqisinitialised = 0;
131  void qqqtotalupload(void);
132  void qqqtotalreset(void);
134  qqqaccumupload[x]=y;
135  qqqaccumreset[x]=z;
136  QQQfcn_ptr_num++;
137  }
138 #else /* (QQQMAINFL) */
139  extern int QQQfcn_ptr_num;
142  static int qqqstructzzopen = 0;
143 #endif /* defined(QQQMAINFL) */
144 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
145 #ifdef QQQ_KEEPCOMMENTS
146  /* -----------------------------------------------------------------------* 101 *
147  * Special settings for systems lacking standard functions.
148  * To include code for fprintf define ldra_fprintf
149  * To include code for sscanf define ldra_sscanf
150  * -----------------------------------------------------------------------------
151  */
152 #endif /* QQQ_KEEPCOMMENTS */
153 #if !defined(QQQSUPPRESS_UNDEF)
154 #undef ldra_fprintf
155 #undef ldra_sscanf
156 #endif /* !defined(QQQSUPPRESS_UNDEF) */
157  /* #define ldra_fprintf */
158  /* #define ldra_sscanf */
159 #undef QQQHITMAP_STORAGE
160 #undef qqnull_params
161 #define qqnull_params void
162 #define QQQ_PROTOTYPE_DEF
163  /* Conventional Instrumentation */
164 #undef QQ_ANSI_PROTOTYPE
165 #ifdef __STDC__
166 #define QQ_ANSI_PROTOTYPE 1
167 #else /* __STDC__ */
168 #ifdef VAXC
169 #define QQ_ANSI_PROTOTYPE 1
170 #endif /* VAXC */
171 #endif /* __STDC__ */
172  static unsigned char qqqzzglobflag = 0;
173  static struct bitmapstruct_t
174  {
175 #define ELEMENT(N) qqqbitmapint element##N;
176 #define LASTELEMENT
177 #include "man_59zbelem.def"
178 #undef ELEMENT
179 #undef LASTELEMENT
180  } bitmapstruct = {
181 #define ELEMENT(N) 0,
182 #undef LASTELEMENT
183 #include "man_59zbelem.def"
184 #undef ELEMENT
185  0};
186  static void qqoutput(FILEPOINT char * s,int i);
187  static void qqoutput2(FILEPOINT char * s,int i, int j);
188  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
189  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
190  static void qqoutput0(FILEPOINT char * s);
191  static int man_59zqqzqz(qqnull_params);
192  static int man_59zqqzqz1(qqnull_params);
193  static int man_59zqendz (int qqqi);
194  static int man_59zqzqzq (int qqqi);
195  static void qqqupload(qqnull_params);
196  static void qqqbitmapreset(qqnull_params);
197 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
198 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h */
199 /**************************************************************************************/
213 /**************************************************************************************/
214 #ifndef MAN_H /* Guard against multiple inclusion.*/
215 #define MAN_H
216 /**************************************************************************************/
217 /**************************************************************************************/
218 /* Section: Included Files */
219 /**************************************************************************************/
220 /**************************************************************************************/
221 #include <stdbool.h>
222 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
223 /*******************************************************************************
224  MPLAB Harmony System Configuration Header
225  File Name:
226  system_config.h
227  Summary:
228  Build-time configuration header for the system defined by this MPLAB Harmony
229  project.
230  Description:
231  An MPLAB Project may have multiple configurations. This file defines the
232  build-time options for a single configuration.
233  Remarks:
234  This configuration header must not define any prototypes or data
235  definitions (or include any files that do). It only provides macro
236  definitions for build-time configuration options that are not instantiated
237  until used by another MPLAB Harmony module or application.
238  Created with MPLAB Harmony Version 2.06
239 *******************************************************************************/
240 // DOM-IGNORE-BEGIN
241 /*******************************************************************************
242 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
243 Microchip licenses to you the right to use, modify, copy and distribute
244 Software only when embedded on a Microchip microcontroller or digital signal
245 controller that is integrated into your product or third party product
246 (pursuant to the sublicense terms in the accompanying license agreement).
247 You should refer to the license agreement accompanying this Software for
248 additional information regarding your rights and obligations.
249 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
250 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
251 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
252 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
253 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
254 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
255 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
256 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
257 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
258 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
259 *******************************************************************************/
260 // DOM-IGNORE-END
261 #ifndef _SYSTEM_CONFIG_H
262 #define _SYSTEM_CONFIG_H
263 // *****************************************************************************
264 // *****************************************************************************
265 // Section: Included Files
266 // *****************************************************************************
267 // *****************************************************************************
268 /* This section Includes other configuration headers necessary to completely
269  define this configuration.
270 */
271 // DOM-IGNORE-BEGIN
272 // DOM-IGNORE-END
273 // *****************************************************************************
274 // *****************************************************************************
275 // Section: System Service Configuration
276 // *****************************************************************************
277 // *****************************************************************************
278 // *****************************************************************************
279 /* Common System Service Configuration Options
280 */
281 #define SYS_VERSION_STR "2.06"
282 #define SYS_VERSION 20600
283 // *****************************************************************************
284 /* Clock System Service Configuration Options
285 */
286 #define SYS_CLK_FREQ 200000000ul
287 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
288 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
289 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
290 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
291 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
292 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
293 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
294 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
295 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
296 /*** Ports System Service Configuration ***/
297 #define SYS_PORT_A_ANSEL 0x3F00
298 #define SYS_PORT_A_TRIS 0xFFED
299 #define SYS_PORT_A_LAT 0x0010
300 #define SYS_PORT_A_ODC 0x0000
301 #define SYS_PORT_A_CNPU 0x0020
302 #define SYS_PORT_A_CNPD 0x0000
303 #define SYS_PORT_A_CNEN 0x0021
304 #define SYS_PORT_B_ANSEL 0x10C8
305 #define SYS_PORT_B_TRIS 0x91FF
306 #define SYS_PORT_B_LAT 0x0000
307 #define SYS_PORT_B_ODC 0x0000
308 #define SYS_PORT_B_CNPU 0x0000
309 #define SYS_PORT_B_CNPD 0x0000
310 #define SYS_PORT_B_CNEN 0x0000
311 #define SYS_PORT_C_ANSEL 0xCFE1
312 #define SYS_PORT_C_TRIS 0xFFFF
313 #define SYS_PORT_C_LAT 0x0000
314 #define SYS_PORT_C_ODC 0x0000
315 #define SYS_PORT_C_CNPU 0x0000
316 #define SYS_PORT_C_CNPD 0x0000
317 #define SYS_PORT_C_CNEN 0x0000
318 #define SYS_PORT_D_ANSEL 0xC100
319 #define SYS_PORT_D_TRIS 0xFFFF
320 #define SYS_PORT_D_LAT 0x0000
321 #define SYS_PORT_D_ODC 0x0000
322 #define SYS_PORT_D_CNPU 0x0000
323 #define SYS_PORT_D_CNPD 0x0000
324 #define SYS_PORT_D_CNEN 0x0000
325 #define SYS_PORT_E_ANSEL 0xFC00
326 #define SYS_PORT_E_TRIS 0xFDFF
327 #define SYS_PORT_E_LAT 0x0000
328 #define SYS_PORT_E_ODC 0x0000
329 #define SYS_PORT_E_CNPU 0x0000
330 #define SYS_PORT_E_CNPD 0x0000
331 #define SYS_PORT_E_CNEN 0x0000
332 #define SYS_PORT_F_ANSEL 0xCEC0
333 #define SYS_PORT_F_TRIS 0xEFFF
334 #define SYS_PORT_F_LAT 0x0000
335 #define SYS_PORT_F_ODC 0x0000
336 #define SYS_PORT_F_CNPU 0x0000
337 #define SYS_PORT_F_CNPD 0x0000
338 #define SYS_PORT_F_CNEN 0x0000
339 #define SYS_PORT_G_ANSEL 0x8CBC
340 #define SYS_PORT_G_TRIS 0xDFFF
341 #define SYS_PORT_G_LAT 0x0000
342 #define SYS_PORT_G_ODC 0x0000
343 #define SYS_PORT_G_CNPU 0x0000
344 #define SYS_PORT_G_CNPD 0x0000
345 #define SYS_PORT_G_CNEN 0x0000
346 #define SYS_PORT_H_ANSEL 0x0070
347 #define SYS_PORT_H_TRIS 0xB3FB
348 #define SYS_PORT_H_LAT 0x0000
349 #define SYS_PORT_H_ODC 0x0000
350 #define SYS_PORT_H_CNPU 0x0000
351 #define SYS_PORT_H_CNPD 0x0000
352 #define SYS_PORT_H_CNEN 0x0000
353 #define SYS_PORT_J_ANSEL 0x0000
354 #define SYS_PORT_J_TRIS 0x8B7F
355 #define SYS_PORT_J_LAT 0x0080
356 #define SYS_PORT_J_ODC 0x0000
357 #define SYS_PORT_J_CNPU 0x0000
358 #define SYS_PORT_J_CNPD 0x0000
359 #define SYS_PORT_J_CNEN 0x0800
360 #define SYS_PORT_K_ANSEL 0xFF00
361 #define SYS_PORT_K_TRIS 0xFFFF
362 #define SYS_PORT_K_LAT 0x0000
363 #define SYS_PORT_K_ODC 0x0000
364 #define SYS_PORT_K_CNPU 0x0000
365 #define SYS_PORT_K_CNPD 0x0000
366 #define SYS_PORT_K_CNEN 0x0000
367 /*** Interrupt System Service Configuration ***/
368 #define SYS_INT true
369 /*** Timer System Service Configuration ***/
370 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
371 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
372 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
373 #define SYS_TMR_FREQUENCY 1000
374 #define SYS_TMR_FREQUENCY_TOLERANCE 10
375 #define SYS_TMR_UNIT_RESOLUTION 10000
376 #define SYS_TMR_CLIENT_TOLERANCE 10
377 #define SYS_TMR_INTERRUPT_NOTIFICATION false
378 // *****************************************************************************
379 // *****************************************************************************
380 // Section: Driver Configuration
381 // *****************************************************************************
382 // *****************************************************************************
383 #define DRV_IC_DRIVER_MODE_STATIC
384 #define USE_8BIT_PMP
385 /*** SPI Driver Configuration ***/
386 #define DRV_SPI_NUMBER_OF_MODULES 6
387 /*** Driver Compilation and static configuration options. ***/
388 /*** Select SPI compilation units.***/
389 #define DRV_SPI_POLLED 1
390 #define DRV_SPI_ISR 0
391 #define DRV_SPI_MASTER 1
392 #define DRV_SPI_SLAVE 0
393 #define DRV_SPI_RM 0
394 #define DRV_SPI_EBM 1
395 #define DRV_SPI_8BIT 1
396 #define DRV_SPI_16BIT 1
397 #define DRV_SPI_32BIT 0
398 #define DRV_SPI_DMA 0
399 /*** SPI Driver Static Allocation Options ***/
400 #define DRV_SPI_INSTANCES_NUMBER 3
401 #define DRV_SPI_CLIENTS_NUMBER 3
402 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
403 /* SPI Driver Instance 0 Configuration */
404 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
405 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
406 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
407 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
408 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
409 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
410 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
411 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
412 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
413 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
414 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
415 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
416 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
417 #define DRV_SPI_BAUD_RATE_IDX0 1000000
418 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
419 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
420 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
421 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
422 #define DRV_SPI_QUEUE_SIZE_IDX0 10
423 #define DRV_SPI_RESERVED_JOB_IDX0 1
424 /* SPI Driver Instance 1 Configuration */
425 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
426 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
427 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
428 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
429 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
430 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
431 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
432 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
433 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
434 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
435 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
436 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
437 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
438 #define DRV_SPI_BAUD_RATE_IDX1 1000000
439 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
440 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
441 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
442 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
443 #define DRV_SPI_QUEUE_SIZE_IDX1 10
444 #define DRV_SPI_RESERVED_JOB_IDX1 1
445 /* SPI Driver Instance 2 Configuration */
446 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
447 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
448 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
449 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
450 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
451 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
452 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
453 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
454 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
455 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
456 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
457 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
458 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
459 #define DRV_SPI_BAUD_RATE_IDX2 500000
460 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
461 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
462 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
463 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
464 #define DRV_SPI_QUEUE_SIZE_IDX2 10
465 #define DRV_SPI_RESERVED_JOB_IDX2 1
466 /*** Timer Driver Configuration ***/
467 #define DRV_TMR_INTERRUPT_MODE true
468 /*** Timer Driver 0 Configuration ***/
469 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
470 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
471 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
472 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
473 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
474 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
475 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
476 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
477 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
478 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
479 #define DRV_TMR_POWER_STATE_IDX0
480 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
481 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
482 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
483 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
484 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
485 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
486 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
487 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
488 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
489 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
490 #define DRV_TMR_POWER_STATE_IDX1
491 /*** Timer Driver 2 Configuration ***/
492 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
493 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
494 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
495 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
496 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
497 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
498 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
499 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
500 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
501 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
502 #define DRV_TMR_POWER_STATE_IDX2
503 /*** Timer Driver 3 Configuration ***/
504 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
505 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
506 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
507 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
508 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
509 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
510 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
511 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
512 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
513 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
514 #define DRV_TMR_POWER_STATE_IDX3
515 /*** Timer Driver 4 Configuration ***/
516 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
517 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
518 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
519 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
520 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
521 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
522 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
523 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
524 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
525 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
526 #define DRV_TMR_POWER_STATE_IDX4
527  // *****************************************************************************
528 /* USART Driver Configuration Options
529 */
530 #define DRV_USART_INSTANCES_NUMBER 1
531 #define DRV_USART_CLIENTS_NUMBER 1
532 #define DRV_USART_INTERRUPT_MODE false
533 #define DRV_USART_BYTE_MODEL_SUPPORT true
534 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
535 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
536 // *****************************************************************************
537 // *****************************************************************************
538 // Section: Middleware & Other Library Configuration
539 // *****************************************************************************
540 // *****************************************************************************
541 /*** USB Driver Configuration ***/
542 /* Enables Device Support */
543 #define DRV_USBHS_DEVICE_SUPPORT true
544 /* Disable Host Support */
545 #define DRV_USBHS_HOST_SUPPORT false
546 /* Maximum USB driver instances */
547 #define DRV_USBHS_INSTANCES_NUMBER 1
548 /* Interrupt mode enabled */
549 #define DRV_USBHS_INTERRUPT_MODE true
550 /* Number of Endpoints used */
551 #define DRV_USBHS_ENDPOINTS_NUMBER 2
552 /*** USB Device Stack Configuration ***/
553 /* The USB Device Layer will not initialize the USB Driver */
554 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
555 /* Maximum device layer instances */
556 #define USB_DEVICE_INSTANCES_NUMBER 1
557 /* EP0 size in bytes */
558 #define USB_DEVICE_EP0_BUFFER_SIZE 64
559 /* Endpoint Transfer Queue Size combined for Read and write */
560 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
561 // *****************************************************************************
562 // *****************************************************************************
563 // Section: Application Configuration
564 // *****************************************************************************
565 // *****************************************************************************
566 /*** Application Defined Pins ***/
567 /*** Functions for LED1 pin ***/
568 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
569 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
570 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
571 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
572 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
573 /*** Functions for LED2 pin ***/
574 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
575 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
576 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
577 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
578 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
579 /*** Functions for DMP_FIRE_LED pin ***/
580 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
581 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
582 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
583 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
584 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
585 /*** Functions for HVPS_ENB pin ***/
586 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
587 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
588 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
589 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
590 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
591 /*** Functions for RLY_HVPS_OUT pin ***/
592 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
593 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
594 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
595 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
596 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
597 /*** Functions for RLY_WL_SPS_POL pin ***/
598 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
599 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
600 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
601 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
602 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
603 /*** Functions for RLY_LOG pin ***/
604 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
605 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
606 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
607 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
608 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
609 /*** Functions for RLY_DMP_FIRE pin ***/
610 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
611 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
612 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
613 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
614 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
615 /*** Functions for RLY_AUX pin ***/
616 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
617 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
618 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
619 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
620 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
621 /*** Functions for RLY_CCL pin ***/
622 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
623 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
624 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
625 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
626 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
627 /*** Functions for RLY_WL_MON pin ***/
628 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
629 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
630 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
631 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
632 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
633 /*** Functions for RLY_ARMCF pin ***/
634 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
635 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
636 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
637 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
638 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
639 /*** Functions for RLY_ARM pin ***/
640 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
641 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
642 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
643 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
644 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
645 /*** Functions for TPAN1 pin ***/
646 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
647 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
648 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
649 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
650 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
651 /*** Functions for TPAN2 pin ***/
652 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
653 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
654 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
655 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
656 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
657 /*** Functions for FSK_DAC_CS pin ***/
658 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
659 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
660 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
661 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
662 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
663 /*** Functions for RLY_COMM pin ***/
664 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
665 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
666 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
667 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
668 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
669 /*** Functions for FSK_DAC_CLR pin ***/
670 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
671 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
672 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
673 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
674 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
675 /*** Functions for WL_CPS_SW pin ***/
676 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
677 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
678 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
679 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
680 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
681 /*** Functions for HVPS_SW pin ***/
682 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
683 /*** Functions for MAN_SIG pin ***/
684 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
685 /*** Functions for DMP_FIRE_SW pin ***/
686 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
687 /*** Functions for NEG_SW pin ***/
688 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
689 /*** Functions for POS_SW pin ***/
690 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
691 /*** Functions for DRUM1_SW pin ***/
692 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
693 /*** Functions for SAFE_SW pin ***/
694 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
695 /*** Functions for DRUM2_SW pin ***/
696 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
697 /*** Functions for LOG_SW pin ***/
698 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
699 /*** Functions for AUX_SW pin ***/
700 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
701 /*** Functions for ARMCF_SW pin ***/
702 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
703 /*** Functions for ARM_SW pin ***/
704 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
705 /*** Functions for ARMCF_AUTO_SW pin ***/
706 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
707 /*** Functions for FIRE_SW_OFF pin ***/
708 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
709 /*** Functions for FIRE_SW_ON pin ***/
710 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
711 /*** Functions for WL_SPS_POS_DET pin ***/
712 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
713 /*** Functions for WL_SPS_NEG_DET pin ***/
714 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
715 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
716 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
717 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
718 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
719 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
720 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
721 /*** Application Instance 0 Configuration ***/
722 //DOM-IGNORE-BEGIN
723 //DOM-IGNORE-END
724  // _SYSTEM_CONFIG_H
725 /*******************************************************************************
726  End of File
727 */
728 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
729 /* CLOSE_FILE Include File */
730 
731 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
732 /*******************************************************************************
733  System Definitions
734  File Name:
735  system_definitions.h
736  Summary:
737  MPLAB Harmony project system definitions.
738  Description:
739  This file contains the system-wide prototypes and definitions for an MPLAB
740  Harmony project.
741  *******************************************************************************/
742 //DOM-IGNORE-BEGIN
743 /*******************************************************************************
744 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
745 Microchip licenses to you the right to use, modify, copy and distribute
746 Software only when embedded on a Microchip microcontroller or digital signal
747 controller that is integrated into your product or third party product
748 (pursuant to the sublicense terms in the accompanying license agreement).
749 You should refer to the license agreement accompanying this Software for
750 additional information regarding your rights and obligations.
751 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
752 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
753 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
754 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
755 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
756 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
757 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
758 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
759 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
760 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
761  *******************************************************************************/
762 //DOM-IGNORE-END
763 #ifndef _SYS_DEFINITIONS_H
764 #define _SYS_DEFINITIONS_H
765 // *****************************************************************************
766 // *****************************************************************************
767 // Section: Included Files
768 // *****************************************************************************
769 // *****************************************************************************
770 #include <stdint.h>
771 #include <stddef.h>
772 #include <stdbool.h>
773 #include "system/common/sys_common.h"
774 #include "system/common/sys_module.h"
775 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
776 /*******************************************************************************
777  Input Capture Driver Interface Declarations for Static Single Instance Driver
778  Company:
779  Microchip Technology Inc.
780  File Name:
781  help_drv_ic.h
782  Summary:
783  Input Capture driver interface declarations for the static single instance
784  driver.
785  Description:
786  The Input Capture device driver provides a simple interface to manage the
787  Input Capture modules on Microchip microcontrollers. This file defines
788  the interface declarations for the IC driver.
789 
790  Remarks:
791  Static interfaces incorporate the driver instance number within the names
792  of the routines, eliminating the need for an object ID or object handle.
793 
794  Static single-open interfaces also eliminate the need for the open handle.
795 *******************************************************************************/
796 //DOM-IGNORE-BEGIN
797 /*******************************************************************************
798 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
799 Microchip licenses to you the right to use, modify, copy and distribute
800 Software only when embedded on a Microchip microcontroller or digital signal
801 controller that is integrated into your product or third party product
802 (pursuant to the sublicense terms in the accompanying license agreement).
803 You should refer to the license agreement accompanying this Software for
804 additional information regarding your rights and obligations.
805 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
806 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
807 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
808 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
809 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
810 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
811 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
812 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
813 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
814 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
815 *******************************************************************************/
816 //DOM-IGNORE-END
817 #ifndef _DRV_IC_H
818 #define _DRV_IC_H
819 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
820 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
821 /*******************************************************************************
822  Driver Common Header Definitions
823  Company:
824  Microchip Technology Inc.
825  File Name:
826  drv_common.h
827  Summary:
828  This file defines the common macros and definitions used by the driver
829  definition and implementation headers.
830  Description:
831  This file defines the common macros and definitions used by the driver
832  definition and the implementation header.
833  Remarks:
834  The directory in which this file resides should be added to the compiler's
835  search path for header files.
836  *******************************************************************************/
837 //DOM-IGNORE-BEGIN
838 /*******************************************************************************
839 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
840 Microchip licenses to you the right to use, modify, copy and distribute
841 Software only when embedded on a Microchip microcontroller or digital signal
842 controller that is integrated into your product or third party product
843 (pursuant to the sublicense terms in the accompanying license agreement).
844 You should refer to the license agreement accompanying this Software for
845 additional information regarding your rights and obligations.
846 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
847 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
848 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
849 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
850 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
851 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
852 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
853 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
854 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
855 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
856  *******************************************************************************/
857 //DOM-IGNORE-END
858 #ifndef _DRV_COMMON_H
859 #define _DRV_COMMON_H
860 #include <stdint.h>
861 #include <stddef.h>
862 // *****************************************************************************
863 /* Device Driver I/O Intent
864  Summary:
865  Identifies the intended usage of the device when it is opened.
866  Description:
867  This enumeration identifies the intended usage of the device when the
868  caller opens the device. It identifies the desired behavior of the device
869  driver for the following:
870  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
871  block until the operation is finished or do they return immediately and
872  require the caller to call another routine to check the status of the
873  operation)
874  * Support reading and/or writing of data from/to the device
875  * Identify the buffering behavior (sometimes called "double buffering" of
876  the driver. Indicates if the driver should maintain its own read/write
877  buffers and copy data to/from these buffers to/from the caller's buffers.
878  * Identify the DMA behavior of the peripheral
879  Remarks:
880  The buffer allocation method is not identified by this enumeration. Buffers
881  can be allocated statically at build time, dynamically at run-time, or
882  even allocated by the caller and passed to the driver for its own usage if
883  a driver-specific routine is provided for such. This choice is left to
884  the design of the individual driver and is considered part of its
885  interface.
886  These values can be considered "flags". One selection from each of the
887  groups below can be ORed together to create the complete value passed
888  to the driver's open routine.
889 */
890 
891 typedef
892  enum
893  {
894  /* Read */
895  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
896  = 1 << 0 /* DOM-IGNORE-END*/
897  ,
898  /* Write */
899  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
900  = 1 << 1 /* DOM-IGNORE-END*/
901  ,
902  /* Read and Write*/
903  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
904  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
905  ,
906  /* The driver will block and will return when the operation is complete */
907  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
908  = 0 << 2 /* DOM-IGNORE-END*/
909  ,
910  /* The driver will return immediately */
911  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
912  = 1 << 2 /* DOM-IGNORE-END*/
913  ,
914  /* The driver will support only one client at a time */
915  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
916  = 1 << 3 /* DOM-IGNORE-END*/
917  ,
918  /* The driver will support multiple clients at a time */
919  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
920  = 0 << 3 /* DOM-IGNORE-END*/
921  } DRV_IO_INTENT ;
922 // *****************************************************************************
923 /* Driver Client Status
924  Summary:
925  Identifies the current status/state of a client's connection to a driver.
926  Description:
927  This enumeration identifies the current status/state of a client's link to
928  a driver.
929  Remarks:
930  The enumeration used as the return type for the client-level status routines
931  defined by each device driver or system module (for example,
932  DRV_USART_ClientStatus) must be based on the values in this enumeration.
933 */
934 
935 typedef
936  enum
937  {
938  /* Indicates that a driver-specific error has occurred. */
940  /* An unspecified error has occurred.*/
942  /* The driver is closed, no operations for this client are ongoing,
943  and/or the given handle is invalid. */
945  /* The driver is currently busy and cannot start additional operations. */
947  /* The module is running and ready for additional operations */
949  /* Indicates that the module is in a driver-specific ready/run state. */
952 // *****************************************************************************
953 /* Device Driver Blocking Status Macro
954  Summary:
955  Returns if the I/O intent provided is blocking
956  Description:
957  This macro returns if the I/O intent provided is blocking.
958  Remarks:
959  None.
960 */
961 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
962 // *****************************************************************************
963 /* Device Driver Non Blocking Status Macro
964  Summary:
965  Returns if the I/O intent provided is non-blocking.
966  Description:
967  This macro returns if the I/ intent provided is non-blocking.
968  Remarks:
969  None.
970 */
971 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
972 // *****************************************************************************
973 /* Device Driver Exclusive Status Macro
974  Summary:
975  Returns if the I/O intent provided is non-blocking.
976  Description:
977  This macro returns if the I/O intent provided is non-blocking.
978  Remarks:
979  None.
980 */
981 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
982 // *****************************************************************************
983 /* Device Driver IO Buffer Identifier
984  Summary:
985  Identifies to which buffer a device operation will apply.
986  Description:
987  This enumeration identifies to which buffer (read, write, both, or neither)
988  a device operation will apply. This is used for "flush" (or similar)
989  operations.
990 */
991 
992 typedef
993  enum
994  {
995  // Operation does not apply to any buffer
997  // Operation applies to read buffer
999  // Operation applies to write buffer
1001  // Operation applies to both read and write buffers
1004 // *****************************************************************************
1005 /* Device Handle
1006  Summary:
1007  Handle to an opened device driver.
1008  Description:
1009  This handle identifies the open instance of a device driver. It must be
1010  passed to all other driver routines (except the initialization, deinitialization,
1011  or power routines) to identify the caller.
1012  Remarks:
1013  Every application or module that wants to use a driver must first call
1014  the driver's open routine. This is the only routine that is absolutely
1015  required for every driver.
1016  If a driver is unable to allow an additional module to use it, it must then
1017  return the special value DRV_HANDLE_INVALID. Callers should check the
1018  handle returned for this value to ensure this value was not returned before
1019  attempting to call any other driver routines using the handle.
1020 */
1021 
1022 typedef
1023 uintptr_t
1025 // *****************************************************************************
1026 /* Invalid Device Handle
1027  Summary:
1028  Invalid device handle.
1029  Description:
1030  If a driver is unable to allow an additional module to use it, it must then
1031  return the special value DRV_HANDLE_INVALID. Callers should check the
1032  handle returned for this value to ensure this value was not returned before
1033  attempting to call any other driver routines using the handle.
1034  Remarks:
1035  None.
1036 */
1037 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1038 // *****************************************************************************
1039 /* Not supported configuration
1040  Summary:
1041  Not supported configuration.
1042  Description:
1043  If the configuration option is not supported on an instance of the
1044  peripheral, use this macro to equate to that configuration. This option
1045  should be listed as a possible value in the description of that
1046  configuration option.
1047 */
1048 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1049 // *****************************************************************************
1050 /* Unsupported Attribute Abstraction
1051  Summary:
1052  Abstracts the use of the unsupported attribute defined by the compiler.
1053  Description:
1054  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1055  compilation of the drivers for all different variants.
1056  Example:
1057  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1058  This function will not generate a compiler error if the interface is not
1059  defined for the selected device.
1060  Remarks:
1061  None.
1062 */
1063 #define _PLIB_UNSUPPORTED
1064  //_DRV_COMMON_H
1065 /*******************************************************************************
1066  End of File
1067 */
1068 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1069 /* CLOSE_FILE Include File */
1070 
1071 #include "system/common/sys_module.h"
1072 // *****************************************************************************
1073 /* IC Driver Module Index Numbers
1074  Summary:
1075  IC driver index definitions.
1076  Description:
1077  These constants provide IC Driver index definitions.
1078  Remarks:
1079  These constants should be used in place of hard-coded numeric literals.
1080  These values should be passed into the DRV_IC_Initialize and
1081  DRV_IC_Open routines to identify the driver instance in use.
1082 */
1083 #define DRV_IC_INDEX_0 0
1084 #define DRV_IC_INDEX_1 1
1085 #define DRV_IC_INDEX_2 2
1086 #define DRV_IC_INDEX_3 3
1087 #define DRV_IC_INDEX_4 4
1088 #define DRV_IC_INDEX_5 5
1089 #define DRV_IC_INDEX_6 6
1090 #define DRV_IC_INDEX_7 7
1091 #define DRV_IC_INDEX_8 8
1092 #define DRV_IC_INDEX_9 9
1093 #define DRV_IC_INDEX_10 10
1094 #define DRV_IC_INDEX_11 11
1095 #define DRV_IC_INDEX_12 12
1096 #define DRV_IC_INDEX_13 13
1097 #define DRV_IC_INDEX_14 14
1098 #define DRV_IC_INDEX_15 15
1099 // *****************************************************************************
1100 // *****************************************************************************
1101 // Section: Interface Headers for the static driver
1102 // *****************************************************************************
1103 // *****************************************************************************
1104 // *****************************************************************************
1105 /* Function:
1106  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1107  const SYS_MODULE_INIT * const init);
1108  Summary:
1109  Initializes the Input Capture instance for the specified driver index.
1110  <p><b>Implementation:</b> Static</p>
1111  Description:
1112  This routine initializes the Input Capture driver instance for the specified
1113  driver instance, making it ready for clients to use it. The initialization
1114  routine is specified by the MHC parameters. The driver instance index is
1115  independent of the Input Capture module ID. For example, driver instance 0
1116  can be assigned to Input Capture 2.
1117  Precondition:
1118  None.
1119  Parameters:
1120  None.
1121  Returns:
1122  None.
1123  Remarks:
1124  This routine must be called before any other Input Capture routine is called.
1125  This routine should only be called once during system initialization.
1126 */
1127 
1128 SYS_MODULE_OBJ
1130  const SYS_MODULE_INDEX index ,
1131  const SYS_MODULE_INIT * const init ) ;
1132 // *****************************************************************************
1133 /* Function:
1134 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1135  Summary:
1136  Opens the Input Capture instance for the specified driver index.
1137  <p><b>Implementation:</b> Static</p>
1138  Description:
1139  This routine starts the Input Capture driver for the specified driver
1140  index, starting an input capture.
1141  Precondition:
1142  DRV_IC_Initialize has been called.
1143  Parameters:
1144  None.
1145  Returns:
1146  None.
1147  Remarks:
1148  None.
1149 */
1150 
1151 DRV_HANDLE
1152  DRV_IC_Open (
1153  const SYS_MODULE_INDEX drvIndex ,
1154  const DRV_IO_INTENT intent ) ;
1155 // *****************************************************************************
1156 /* Function:
1157  void DRV_IC_Close(DRV_HANDLE handle)
1158  Summary:
1159  Closes the Input Capture instance for the specified driver index.
1160  <p><b>Implementation:</b> Static</p>
1161  Description:
1162  This routine stops the Input Capture driver for the specified driver
1163  index, stopping an input capture.
1164  Precondition:
1165  DRV_IC_Initialize has been called.
1166  Parameters:
1167  None.
1168  Returns:
1169  None.
1170  Remarks:
1171  None.
1172 */
1173 
1174 void
1175  DRV_IC_Close (
1176  DRV_HANDLE handle ) ;
1177 // *****************************************************************************
1178 /* Function:
1179 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1180  Summary:
1181  Starts the Input Capture instance for the specified driver index.
1182  <p><b>Implementation:</b> Static</p>
1183  Description:
1184  This routine starts the Input Capture driver for the specified driver
1185  index, starting an input capture.
1186  Precondition:
1187  DRV_IC_Initialize has been called.
1188  Parameters:
1189  None.
1190  Returns:
1191  None.
1192  Remarks:
1193  None.
1194 */
1195 
1196 DRV_HANDLE
1197  DRV_IC_Start (
1198  const SYS_MODULE_INDEX drvIndex ,
1199  const DRV_IO_INTENT intent ) ;
1200 // *****************************************************************************
1201 /* Function:
1202  void DRV_IC_Stop(DRV_HANDLE handle)
1203  Summary:
1204  Stops the Input Capture instance for the specified driver index.
1205  <p><b>Implementation:</b> Static</p>
1206  Description:
1207  This routine stops the Input Capture driver for the specified driver
1208  index, stopping an input capture.
1209  Precondition:
1210  DRV_IC_Initialize has been called.
1211  Parameters:
1212  None.
1213  Returns:
1214  None.
1215  Remarks:
1216  None.
1217 */
1218 
1219 void
1220  DRV_IC_Stop (
1221  DRV_HANDLE handle ) ;
1222 // *****************************************************************************
1223 /* Function:
1224  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1225  Summary:
1226  Reads the 32-bit Input Capture for the specified driver index.
1227  <p><b>Implementation:</b> Static</p>
1228  Description:
1229  This routine reads the 32-bit data for the specified driver index
1230  Precondition:
1231  DRV_IC_Initialize has been called.
1232  Parameters:
1233  None.
1234  Returns:
1235  uint32_t value of the data read from the Input Capture.
1236  Remarks:
1237  None.
1238 */
1239 
1240 uint32_t
1242  DRV_HANDLE handle ) ;
1243 // *****************************************************************************
1244 /* Function:
1245  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1246  Summary:
1247  Reads the 16-bit Input Capture for the specified driver index.
1248  <p><b>Implementation:</b> Static</p>
1249  Description:
1250  This routine reads the 16-bit data for the specified driver index.
1251  Precondition:
1252  DRV_IC_Initialize has been called.
1253  Parameters:
1254  None.
1255  Returns:
1256  uint16_t value of the data read from the Input Capture.
1257  Remarks:
1258  None.
1259 */
1260 
1261 uint16_t
1263  DRV_HANDLE handle ) ;
1264 // *****************************************************************************
1265 /* Function:
1266  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1267  Summary:
1268  Returns the Input Capture instance buffer empty status for the specified driver
1269  index.
1270  <p><b>Implementation:</b> Static</p>
1271  Description:
1272  Returns the Input Capture instance buffer empty status for the specified driver
1273  index. The function should be called to determine whether or not the IC buffer
1274  has data.
1275  Precondition:
1276  DRV_IC_Initialize has been called.
1277  Parameters:
1278  None.
1279  Returns:
1280  Boolean
1281  - 1 - Buffer is empty
1282  - 0 - Buffer is not empty
1283  Remarks:
1284  None.
1285 */
1286 
1287 bool
1289  DRV_HANDLE handle ) ;
1290 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1291 /*******************************************************************************
1292  IC Driver Interface Declarations for Static Single Instance Driver
1293  Company:
1294  Microchip Technology Inc.
1295  File Name:
1296  drv_ic_static.h
1297  Summary:
1298  IC driver interface declarations for the static single instance driver.
1299  Description:
1300  The IC device driver provides a simple interface to manage the IC
1301  modules on Microchip microcontrollers. This file defines the interface
1302  Declarations for the IC driver.
1303 
1304  Remarks:
1305  Static interfaces incorporate the driver instance number within the names
1306  of the routines, eliminating the need for an object ID or object handle.
1307 
1308  Static single-open interfaces also eliminate the need for the open handle.
1309 *******************************************************************************/
1310 //DOM-IGNORE-BEGIN
1311 /*******************************************************************************
1312 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1313 Microchip licenses to you the right to use, modify, copy and distribute
1314 Software only when embedded on a Microchip microcontroller or digital signal
1315 controller that is integrated into your product or third party product
1316 (pursuant to the sublicense terms in the accompanying license agreement).
1317 You should refer to the license agreement accompanying this Software for
1318 additional information regarding your rights and obligations.
1319 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1320 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1321 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1322 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1323 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1324 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1325 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1326 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1327 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1328 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1329 *******************************************************************************/
1330 //DOM-IGNORE-END
1331 #ifndef _DRV_IC_STATIC_H
1332 #define _DRV_IC_STATIC_H
1333 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1334 #define DRV_IC_Close( handle )
1335 // *****************************************************************************
1336 // *****************************************************************************
1337 // Section: Interface Headers for Instance 0 for the static driver
1338 // *****************************************************************************
1339 // *****************************************************************************
1340 
1341 void
1342  DRV_IC0_Initialize ( void ) ;
1343 
1344 void
1345  DRV_IC0_Start ( void ) ;
1346 
1347 void
1348  DRV_IC0_Stop ( void ) ;
1349 
1350 uint32_t
1351  DRV_IC0_Capture32BitDataRead ( void ) ;
1352 
1353 uint16_t
1354  DRV_IC0_Capture16BitDataRead ( void ) ;
1355 
1356 bool
1357  DRV_IC0_BufferIsEmpty ( void ) ;
1358  // #ifndef _DRV_IC_STATIC_H
1359 /*******************************************************************************
1360  End of File
1361 */
1362 
1363 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1364 /* CLOSE_FILE Include File */
1365 
1366  // #ifndef _DRV_IC_H
1367 /*******************************************************************************
1368  End of File
1369 */
1370 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1371 /* CLOSE_FILE Include File */
1372 
1373 #include "system/devcon/sys_devcon.h"
1374 #include "system/clk/sys_clk.h"
1375 #include "system/int/sys_int.h"
1376 #include "system/tmr/sys_tmr.h"
1377 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1378 /*******************************************************************************
1379  ADC Driver Interface Declarations for Static Single Instance Driver
1380  Company:
1381  Microchip Technology Inc.
1382  File Name:
1383  drv_adc_static.h
1384  Summary:
1385  ADC driver interface declarations for the static single instance driver.
1386  Description:
1387  The ADC device driver provides a simple interface to manage the ADC
1388  modules on Microchip microcontrollers. This file defines the interface
1389  Declarations for the ADC driver.
1390 
1391  Remarks:
1392  Static interfaces incorporate the driver instance number within the names
1393  of the routines, eliminating the need for an object ID or object handle.
1394 
1395  Static single-open interfaces also eliminate the need for the open handle.
1396 *******************************************************************************/
1397 //DOM-IGNORE-BEGIN
1398 /*******************************************************************************
1399 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1400 Microchip licenses to you the right to use, modify, copy and distribute
1401 Software only when embedded on a Microchip microcontroller or digital signal
1402 controller that is integrated into your product or third party product
1403 (pursuant to the sublicense terms in the accompanying license agreement).
1404 You should refer to the license agreement accompanying this Software for
1405 additional information regarding your rights and obligations.
1406 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1407 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1408 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1409 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1410 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1411 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1412 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1413 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1414 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1415 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1416 *******************************************************************************/
1417 //DOM-IGNORE-END
1418 #ifndef _DRV_ADC_STATIC_H
1419 #define _DRV_ADC_STATIC_H
1420 #include <stdbool.h>
1421 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1422 #include "peripheral/adchs/plib_adchs.h"
1423 #include "peripheral/int/plib_int.h"
1424 
1425 typedef
1426  enum
1427  {
1428  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1430  } DRV_ADC_MODULE_ID ;
1431 // *****************************************************************************
1432 // *****************************************************************************
1433 // Section: Interface Headers for ADC Static Driver
1434 // *****************************************************************************
1435 // *****************************************************************************
1436 
1437 void
1438  DRV_ADC_Initialize ( void ) ;
1439 
1440 inline void
1441  DRV_ADC_DeInitialize ( void ) ;
1442 
1443 inline void
1444  DRV_ADC0_Open ( void ) ;
1445 
1446 inline void
1447  DRV_ADC0_Close ( void ) ;
1448 
1449 inline void
1450  DRV_ADC1_Open ( void ) ;
1451 
1452 inline void
1453  DRV_ADC1_Close ( void ) ;
1454 
1455 inline void
1456  DRV_ADC_Start ( void ) ;
1457 
1458 inline void
1459  DRV_ADC_Stop ( void ) ;
1460 
1461 uint32_t
1463  uint8_t bufIndex ) ;
1464 
1465 bool
1467  uint8_t bufIndex ) ;
1468  // #ifndef _DRV_ADC_STATIC_H
1469 /*******************************************************************************
1470  End of File
1471 */
1472 
1473 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1474 /* CLOSE_FILE Include File */
1475 
1476 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1477 /*******************************************************************************
1478  Timer Driver Interface Declarations for Static Single Instance Driver
1479  Company:
1480  Microchip Technology Inc.
1481  File Name:
1482  drv_tmr_static.h
1483  Summary:
1484  Timer driver interface declarations for the static single instance driver.
1485  Description:
1486  The Timer device driver provides a simple interface to manage the Timer
1487  modules on Microchip microcontrollers. This file defines the interface
1488  Declarations for the TMR driver.
1489 
1490  Remarks:
1491  Static interfaces incorporate the driver instance number within the names
1492  of the routines, eliminating the need for an object ID or object handle.
1493 
1494  Static single-open interfaces also eliminate the need for the open handle.
1495 *******************************************************************************/
1496 //DOM-IGNORE-BEGIN
1497 /*******************************************************************************
1498 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1499 Microchip licenses to you the right to use, modify, copy and distribute
1500 Software only when embedded on a Microchip microcontroller or digital signal
1501 controller that is integrated into your product or third party product
1502 (pursuant to the sublicense terms in the accompanying license agreement).
1503 You should refer to the license agreement accompanying this Software for
1504 additional information regarding your rights and obligations.
1505 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1506 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1507 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1508 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1509 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1510 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1511 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1512 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1513 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1514 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1515 *******************************************************************************/
1516 //DOM-IGNORE-END
1517 #ifndef _DRV_TMR_STATIC_H
1518 #define _DRV_TMR_STATIC_H
1519 // *****************************************************************************
1520 // *****************************************************************************
1521 // Section: Include Headers
1522 // *****************************************************************************
1523 // *****************************************************************************
1524 #include <stdint.h>
1525 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1526 /*******************************************************************************
1527  Timer Device Driver Interface Definition
1528  Company:
1529  Microchip Technology Inc.
1530  File Name:
1531  drv_tmr.h
1532  Summary:
1533  Timer device driver interface header file.
1534  Description:
1535  This header file contains the function prototypes and definitions of the
1536  data types and constants that make up the interface to the Timer device
1537  driver.
1538 *******************************************************************************/
1539 //DOM-IGNORE-BEGIN
1540 /*******************************************************************************
1541 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1542 Microchip licenses to you the right to use, modify, copy and distribute
1543 Software only when embedded on a Microchip microcontroller or digital signal
1544 controller that is integrated into your product or third party product
1545 (pursuant to the sublicense terms in the accompanying license agreement).
1546 You should refer to the license agreement accompanying this Software for
1547 additional information regarding your rights and obligations.
1548 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1549 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1550 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1551 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1552 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1553 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1554 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1555 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1556 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1557 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1558 *******************************************************************************/
1559 //DOM-IGNORE-END
1560 #ifndef _DRV_TMR_H
1561 #define _DRV_TMR_H
1562 // *****************************************************************************
1563 // *****************************************************************************
1564 // Section: File includes
1565 // *****************************************************************************
1566 // *****************************************************************************
1567 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1568 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1569 #include "peripheral/tmr/plib_tmr.h"
1570 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1571 /*******************************************************************************
1572  Timer Device Driver Interface Definition
1573  Company:
1574  Microchip Technology Inc.
1575  File Name:
1576  tmr_definitions_pic32m.h
1577  Summary:
1578  Timer device driver definitions header file.
1579  Description:
1580  This header file contains the definitions of the
1581  data types and constants that make up the interface to the Timer device
1582  driver.
1583 *******************************************************************************/
1584 //DOM-IGNORE-BEGIN
1585 /*******************************************************************************
1586 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1587 Microchip licenses to you the right to use, modify, copy and distribute
1588 Software only when embedded on a Microchip microcontroller or digital signal
1589 controller that is integrated into your product or third party product
1590 (pursuant to the sublicense terms in the accompanying license agreement).
1591 You should refer to the license agreement accompanying this Software for
1592 additional information regarding your rights and obligations.
1593 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1594 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1595 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1596 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1597 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1598 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1599 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1600 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1601 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1602 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1603 *******************************************************************************/
1604 //DOM-IGNORE-END
1605 #ifndef _TMR_DEFINITIONS_PIC32M_H
1606 #define _TMR_DEFINITIONS_PIC32M_H
1607 // DOM-IGNORE-BEGIN
1608 // DOM-IGNORE-END
1609 
1610 typedef
1611  enum
1612  {
1613  /* Clock input to the timer module is internal(Peripheral Clock) */
1615  /*DOM-IGNORE-BEGIN*/
1616  = 0x00 /*DOM-IGNORE-END*/
1617  ,
1618  /* Clock input to the timer module is from T1CK pin (external)
1619  with clock synchronization enabled */
1621  /*DOM-IGNORE-BEGIN*/
1622  = 0x01 /*DOM-IGNORE-END*/
1623  ,
1624  /* Clock input to the timer module is from T1CK pin (external)
1625  with clock synchronization disabled */
1627  /*DOM-IGNORE-BEGIN*/
1628  = 0x11 /*DOM-IGNORE-END*/
1629  ,
1630  /* Clock input to the timer module is from secondary oscillator (external)
1631  with clock synchronization enabled */
1633  /*DOM-IGNORE-BEGIN*/
1634  = 0x02 /*DOM-IGNORE-END*/
1635  ,
1636  /* Clock input to the timer module is from secondary oscillator (external)
1637  with clock synchronization disabled */
1639  /*DOM-IGNORE-BEGIN*/
1640  = 0x12 /*DOM-IGNORE-END*/
1641  ,
1642  /* Clock input to the timer module is from LPRC
1643  with clock synchronization enabled */
1645  /*DOM-IGNORE-BEGIN*/
1646  = 0x03 /*DOM-IGNORE-END*/
1647  ,
1648  /* Clock input to the timer module is from LPRC
1649  with clock synchronization disabled */
1651  /*DOM-IGNORE-BEGIN*/
1652  = 0x13 /*DOM-IGNORE-END*/
1654 //DOM-IGNORE-BEGIN
1655 //DOM-IGNORE-END
1656  // #ifndef _DRV_TMR_H
1657 /*******************************************************************************
1658  End of File
1659 */
1660 
1661 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1662 /* CLOSE_FILE Include File */
1663 
1664 #include "system/int/sys_int.h" // System Interrupt Definitions
1665 #include "system/clk/sys_clk.h"
1666 // DOM-IGNORE-BEGIN
1667 // DOM-IGNORE-END
1668 // *****************************************************************************
1669 // *****************************************************************************
1670 // Section: TMR Driver Data Types
1671 // *****************************************************************************
1672 // *****************************************************************************
1673 // *****************************************************************************
1674 /* Timer Driver Module Index Numbers
1675  Summary:
1676  Timer driver index definitions
1677  Description:
1678  These constants provide Timer driver index definitions.
1679  Remarks:
1680  These constants should be used in place of hard-coded numeric literals.
1681  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1682  functions to identify the driver instance in use.
1683 */
1684 #define DRV_TMR_INDEX_0 0
1685 #define DRV_TMR_INDEX_1 1
1686 #define DRV_TMR_INDEX_2 2
1687 #define DRV_TMR_INDEX_3 3
1688 #define DRV_TMR_INDEX_4 4
1689 #define DRV_TMR_INDEX_5 5
1690 #define DRV_TMR_INDEX_6 6
1691 #define DRV_TMR_INDEX_7 7
1692 #define DRV_TMR_INDEX_8 8
1693 #define DRV_TMR_INDEX_9 9
1694 #define DRV_TMR_INDEX_10 10
1695 #define DRV_TMR_INDEX_11 11
1696 // *****************************************************************************
1697 /* Timer Driver Module Index Count
1698  Summary:
1699  Number of valid Timer driver indices.
1700  Description:
1701  This constant identifies Timer driver index definitions.
1702  Remarks:
1703  This constant should be used in place of hard-coded numeric literals.
1704  This value is device-specific.
1705 */
1706 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1707 // *****************************************************************************
1708 /* Timer Driver Client Status
1709  Summary:
1710  Identifies the client-specific status of the Timer driver
1711  Description:
1712  This enumeration identifies the client-specific status of the Timer driver.
1713  Remarks:
1714  None.
1715 */
1716 
1717 typedef
1718  enum
1719  {
1720  /* Driver is invalid (or unopened) state */
1722  /*DOM-IGNORE-BEGIN*/
1723  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1724  ,
1725  /* An operation is currently in progress */
1727  /*DOM-IGNORE-BEGIN*/
1728  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1729  ,
1730  /* Ready, no operations running */
1732  /*DOM-IGNORE-BEGIN*/
1733  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1734  ,
1735  /* Timer started and running, processing transactions */
1737  /*DOM-IGNORE-BEGIN*/
1738  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1740 // *****************************************************************************
1741 /* Timer Driver Clock sources
1742  Summary:
1743  Lists the clock sources available for timer driver.
1744  Description:
1745  This enumeration lists all the available clock sources for the timer
1746  hardware.
1747  Remarks:
1748  Not all modes are available on all devices.
1749  'Synchronization' may not be applicable for all the instances of the timer.
1750  The driver discards the Synchronization mode selected if it is not
1751  applicable for the selected hardware.
1752 */
1753 // *****************************************************************************
1754 /* Timer Driver Operation mode
1755  Summary:
1756  Lists the operation modes available for timer driver.
1757  Description:
1758  This enumeration lists all the available operation modes that are valid for
1759  the timer hardware.
1760  Remarks:
1761  Not all modes are available on all devices.
1762 */
1763 
1764 typedef
1765  enum
1766  {
1767  /* The timer module operating mode none/invalid */
1769  /* The timer module operates in 16 bit mode */
1771  /* The timer module operates in 32 bit mode */
1772  /* This will combine two 16 bit timer modules */
1775 // *****************************************************************************
1776 /* Timer Driver divider operating specification
1777  Summary:
1778  This data structure specifies the divider values that can be obtained by the
1779  timer module.
1780  Description:
1781  This data structure specifies the divider values that can be obtained by the
1782  timer hardware.
1783  Remarks:
1784  None.
1785 */
1786 
1787 typedef
1788  struct
1789  {
1790  /* The minimum divider value that the timer module can obtain */
1791  uint32_t dividerMin ;
1792  /* The maximum divider value that the timer module can obtain */
1793  uint32_t dividerMax ;
1794  /* The divider step value, between 2 divider values */
1795  /* Should be 1 for most timers */
1796  uint32_t dividerStep ;
1798 // *****************************************************************************
1799 /* Timer Driver Initialize Data
1800  Summary:
1801  Defines the Timer driver initialization data.
1802  Description:
1803  This data type defines data required to initialize the Timer driver.
1804  Remarks:
1805  Not all initialization features are available on all devices.
1806 */
1807 
1808 typedef
1809  struct
1810  {
1811  /* System module initialization. */
1812  SYS_MODULE_INIT moduleInit ;
1813  /* Identifies timer hardware module (PLIB-level) ID */
1814  TMR_MODULE_ID tmrId ;
1815  /* Clock Source select. */
1816  DRV_TMR_CLK_SOURCES clockSource ;
1817  /* Prescaler Selection from the processor enumeration */
1818  TMR_PRESCALE prescale ;
1819  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1820  is selected the interrupt will be generated by the 2nd timer of the pair,
1821  the odd numbered one. */
1822  INT_SOURCE interruptSource ;
1823  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1824  timer modules to form a 32 bit one. This is usually only necessary for
1825  very long delays. */
1826  DRV_TMR_OPERATION_MODE mode ;
1827  /* Asynchronous write enable configuration. If true the asynchronous write
1828  is enabled. For timers that do not support this feature the value is
1829  ignored */
1830  bool asyncWriteEnable ;
1831  } DRV_TMR_INIT ;
1832 // *****************************************************************************
1833 /* Timer Driver Callback Function Pointer
1834  Summary:
1835  Pointer to a Timer driver callback function data type.
1836  Description:
1837  This data type defines a pointer to a Timer driver callback function.
1838  Remarks:
1839  Useful only when timer alarm callback support is enabled by defining the
1840  DRV_TMR_ALARM_ENABLE configuration option.
1841 */
1842 
1843 typedef
1844 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1845 uint32_t alarmCount ) ;
1846 // *****************************************************************************
1847 // *****************************************************************************
1848 // Section: Timer Driver Module Interface Functions
1849 // *****************************************************************************
1850 // *****************************************************************************
1851 // *****************************************************************************
1852 /* Function:
1853  SYS_MODULE_OBJ DRV_TMR_Initialize
1854  (
1855  const SYS_MODULE_INDEX drvIndex,
1856  const SYS_MODULE_INIT * const init
1857  )
1858  Summary:
1859  Initializes the Timer driver.
1860  <p><b>Implementation:</b> Static/Dynamic</p>
1861  Description:
1862  This function initializes the Timer driver, making it ready for clients to
1863  open and use it.
1864  Precondition:
1865  None.
1866  Parameters:
1867  drvIndex - Index for the driver instance to be initialized
1868  init - Pointer to a data structure containing any data necessary
1869  to initialize the driver.
1870  Returns:
1871  If successful, returns a valid handle to a driver object. Otherwise, it
1872  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1873  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1874  Example:
1875  <code>
1876  DRV_TMR_INIT init;
1877  SYS_MODULE_OBJ objectHandle;
1878  // Populate the timer initialization structure
1879  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1880  init.tmrId = TMR_ID_2;
1881  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1882  init.prescale = TMR_PRESCALE_VALUE_256;
1883  init.interruptSource = INT_SOURCE_TIMER_2;
1884  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1885  init.asyncWriteEnable = false;
1886  // Do something
1887  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1888  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1889  {
1890  // Handle error
1891  }
1892  </code>
1893  Remarks:
1894  This function must be called before any other Timer driver function is
1895  called.
1896  This function should only be called once during system initialization unless
1897  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1898  This function will NEVER block for hardware access. The system must use
1899  DRV_TMR_Status to find out when the driver is in the ready state.
1900  Build configuration options may be used to statically override options in
1901  the "init" structure and will take precedence over initialization data
1902  passed using this function.
1903 */
1904 
1905 SYS_MODULE_OBJ
1907  const SYS_MODULE_INDEX drvIndex ,
1908  const SYS_MODULE_INIT * const init ) ;
1909 // *****************************************************************************
1910 /* Function:
1911  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1912  Summary:
1913  Deinitializes the specified instance of the Timer driver.
1914  <p><b>Implementation:</b> Dynamic</p>
1915  Description:
1916  Deinitializes the specified instance of the Timer driver, disabling
1917  its operation (and any hardware). All internal data is invalidated.
1918  Precondition:
1919  The DRV_TMR_Initialize function must have been called before calling this
1920  function and a valid SYS_MODULE_OBJ must have been returned.
1921  Parameters:
1922  object - Driver object handle, returned from DRV_TMR_Initialize
1923  Returns:
1924  None.
1925  Example:
1926  <code>
1927  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1928  SYS_STATUS tmrStatus;
1929  DRV_TMR_Deinitialize ( tmrObject );
1930  tmrStatus = DRV_TMR_Status ( tmrObject );
1931  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1932  {
1933  // Check again later if you need to know
1934  // when the driver is deinitialized.
1935  }
1936  </code>
1937  Remarks:
1938  Once the Initialize operation has been called, the Deinitialize operation
1939  must be called before the Initialize operation can be called again.
1940  This function will NEVER block waiting for hardware. If the operation
1941  requires time to allow the hardware to complete, this will be reported by
1942  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1943  out when the module is in the ready state.
1944 */
1945 
1946 void
1948  SYS_MODULE_OBJ object ) ;
1949 // *****************************************************************************
1950 /* Function:
1951  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1952  Summary:
1953  Provides the current status of the Timer driver.
1954  <p><b>Implementation:</b> Dynamic</p>
1955  Description:
1956  This function provides the current status of the Timer driver.
1957  Precondition:
1958  The DRV_TMR_Initialize function must have been called before calling this
1959  function.
1960  Parameters:
1961  object - Driver object handle, returned from DRV_TMR_Initialize
1962  Returns:
1963  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1964  for operation
1965  Note: Any value greater than SYS_STATUS_READY is
1966  also a normal running state in which the driver
1967  is ready to accept new operations.
1968  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1969  Note: Any value less than SYS_STATUS_ERROR is
1970  also an error state.
1971  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1972  Note: This value is less than SYS_STATUS_ERROR.
1973  Example:
1974  <code>
1975  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1976  SYS_STATUS tmrStatus;
1977  tmrStatus = DRV_TMR_Status ( object );
1978  else if ( SYS_STATUS_ERROR >= tmrStatus )
1979  {
1980  // Handle error
1981  }
1982  </code>
1983  Remarks:
1984  The this operation can be used to determine when any of the driver's module
1985  level operations has completed.
1986  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1987  operation.
1988  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1989  also an error state.
1990  This function will NEVER block waiting for hardware.
1991 */
1992 
1993 SYS_STATUS
1994  DRV_TMR_Status (
1995  SYS_MODULE_OBJ object ) ;
1996 // *****************************************************************************
1997 /* Function:
1998  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1999  Summary:
2000  Maintains the driver's state machine.
2001  <p><b>Implementation:</b> Dynamic</p>
2002  Description:
2003  This function is used to maintain the driver's internal state machine and
2004  processes the timer events..
2005  Precondition:
2006  The DRV_TMR_Initialize function must have been called for the specified Timer
2007  driver instance.
2008  Parameters:
2009  object - Object handle for the specified driver instance (returned from
2010  DRV_TMR_Initialize)
2011  Returns:
2012  None
2013  Example:
2014  <code>
2015  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2016  while (true)
2017  {
2018  DRV_TMR_Tasks ( object );
2019  // Do other tasks
2020  }
2021  </code>
2022  Remarks:
2023  This function is normally not called directly by an application. It is
2024  called by the system's Tasks routine (SYS_Tasks)
2025 */
2026 
2027 void
2028  DRV_TMR_Tasks (
2029  SYS_MODULE_OBJ object ) ;
2030 // *****************************************************************************
2031 // *****************************************************************************
2032 // Section: TMR Driver Client Functions
2033 // *****************************************************************************
2034 // *****************************************************************************
2035 // *****************************************************************************
2036 /* Function:
2037  DRV_HANDLE DRV_TMR_Open
2038  (
2039  const SYS_MODULE_INDEX index,
2040  const DRV_IO_INTENT intent
2041  )
2042  Summary:
2043  Opens the specified Timer driver instance and returns a handle to it.
2044  <p><b>Implementation:</b> Dynamic</p>
2045  Description:
2046  This function opens the specified Timer driver instance and provides a
2047  handle that must be provided to all other client-level operations to
2048  identify the caller and the instance of the driver. Timer driver does not
2049  support multiple clients. If two tasks want to use the timer, one should
2050  wait until the other one gets closed.
2051  Precondition:
2052  The DRV_TMR_Initialize function must have been called before calling this
2053  function.
2054  Parameters:
2055  index - Identifier for the object instance to be opened
2056  intent - Zero or more of the values from the enumeration
2057  DRV_IO_INTENT ORed together to indicate the intended use
2058  of the driver
2059  Returns:
2060  If successful, the function returns a valid open instance handle (a number
2061  identifying both the caller and the module instance).
2062  If an error occurs, the return value is DRV_HANDLE_INVALID.
2063  Example:
2064  <code>
2065  DRV_HANDLE handle;
2066  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2067  if ( DRV_HANDLE_INVALID == handle )
2068  {
2069  // Unable to open the driver
2070  }
2071  </code>
2072  Remarks:
2073  The handle returned is valid until the DRV_TMR_Close function is called.
2074  This function will NEVER block waiting for hardware.
2075  If the requested intent flags are not supported, the function will return
2076  DRV_HANDLE_INVALID.
2077  The Timer driver does not support DRV_IO_INTENT_SHARED.
2078  Only exclusive access is supported for now.
2079 */
2080 
2081 DRV_HANDLE
2082  DRV_TMR_Open (
2083  const SYS_MODULE_INDEX index ,
2084  const DRV_IO_INTENT intent ) ;
2085 // *****************************************************************************
2086 /* Function:
2087  void DRV_TMR_Close ( DRV_HANDLE handle )
2088  Summary:
2089  Closes an opened instance of the Timer driver.
2090  <p><b>Implementation:</b> Dynamic</p>
2091  Description:
2092  This function closes an opened instance of the Timer driver, invalidating
2093  the handle.
2094  Precondition:
2095  The DRV_TMR_Initialize function must have been called for the specified
2096  Timer driver instance.
2097  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2098  Parameters:
2099  handle - A valid open-instance handle, returned from the driver's
2100  open routine
2101  Returns:
2102  None
2103  Example:
2104  <code>
2105  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2106  DRV_TMR_Close ( handle );
2107  </code>
2108  Remarks:
2109  After calling this function, the handle passed in "handle" must not be used
2110  with any of the remaining driver functions. A new handle must be obtained
2111  by calling DRV_TMR_Open before the caller may use the driver again.
2112  Note: Usually there is no need for the driver client to verify that the Close
2113  operation has completed.
2114 */
2115 
2116 void
2117  DRV_TMR_Close (
2118  DRV_HANDLE handle ) ;
2119 // *****************************************************************************
2120 /* Function:
2121  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2122  Summary:
2123  Gets the status of the client operation.
2124  <p><b>Implementation:</b> Dynamic</p>
2125  Description:
2126  This function gets the status of the recently completed client level
2127  operation.
2128  Precondition:
2129  The DRV_TMR_Initialize function must have been called for the specified
2130  Timer driver instance.
2131  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2132  Parameters:
2133  handle - A valid open-instance handle, returned from the driver's
2134  open routine
2135  Returns:
2136  None
2137  Example:
2138  <code>
2139  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2140  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2141  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2142  </code>
2143  Remarks:
2144  None.
2145 */
2146 
2149  DRV_HANDLE handle ) ;
2150 // *****************************************************************************
2151 // *****************************************************************************
2152 // Section: TMR Driver Counting functions
2153 // *****************************************************************************
2154 // *****************************************************************************
2155 // *****************************************************************************
2156 /* Function:
2157  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2158  Summary:
2159  Updates the Timer's counter register.
2160  <p><b>Implementation:</b> Static/Dynamic</p>
2161  Description:
2162  This function updates the Timer's value in the counter register.
2163  Precondition:
2164  The DRV_TMR_Initialize function must have been called.
2165  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2166  Parameters:
2167  handle - A valid open-instance handle, returned from the driver's
2168  open routine
2169  counterPeriod - counter period value
2170  - a 16 bit value if the timer is configured in 16 bit mode
2171  - a 32 bit value if the timer is configured in 32 bit mode
2172  Returns:
2173  None.
2174  Example:
2175  <code>
2176  </code>
2177  Remarks:
2178  None.
2179 */
2180 
2181 void
2183  DRV_HANDLE handle ,
2184  uint32_t counterPeriod ) ;
2185 // *****************************************************************************
2186 /* Function:
2187  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2188  Summary:
2189  Reads the Timer's counter register.
2190  <p><b>Implementation:</b> Static/Dynamic</p>
2191  Description:
2192  This function returns the Timer's value in the counter register.
2193  Precondition:
2194  The DRV_TMR_Initialize function must have been called.
2195  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2196  Parameters:
2197  handle - A valid open-instance handle, returned from the driver's
2198  open routine
2199  Returns:
2200  Timer current period:
2201  - a 16 bit value if the timer is configured in 16 bit mode
2202  - a 32 bit value if the timer is configured in 32 bit mode
2203  Example:
2204  <code>
2205  //Example to use timer for precision time measurement
2206  //without configuring an alarm (interrupt based)
2207  char appState = 0;
2208  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2209  switch ( appState )
2210  {
2211  case 0:
2212  //Calculate and set the counter period
2213  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2214  //counter starts
2215  DRV_TMR_Start ( tmrHandle );
2216  //Trigger an application operation
2217  app_trigger_operation();
2218  //Check for time-out in the next state
2219  appState++;
2220  case 1:
2221  //Overflows and stops at 0 if no alarm is set
2222  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2223  {
2224  //Time-out
2225  return false;
2226  }
2227  else if ( app_operation_isComplete( ) )
2228  {
2229  //Operation is complete before time-out
2230  return true;
2231  }
2232  </code>
2233  Remarks:
2234  None.
2235 */
2236 
2237 uint32_t
2239  DRV_HANDLE handle ) ;
2240 // *****************************************************************************
2241 /* Function:
2242  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2243  Summary:
2244  Clears the Timer's counter register.
2245  <p><b>Implementation:</b> Static/Dynamic</p>
2246  Description:
2247  This function clears the Timer's value in the counter register.
2248  Precondition:
2249  The DRV_TMR_Initialize function must have been called.
2250  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2251  Parameters:
2252  handle - A valid open-instance handle, returned from the driver's
2253  open routine
2254  Returns:
2255  None.
2256  Example:
2257  <code>
2258  </code>
2259  Remarks:
2260  None.
2261 */
2262 
2263 void
2265  DRV_HANDLE handle ) ;
2266 // *****************************************************************************
2267 /* Function:
2268  bool DRV_TMR_AlarmRegister
2269  (
2270  DRV_HANDLE handle,
2271  uint32_t divider,
2272  bool isPeriodic,
2273  uintptr_t context,
2274  DRV_TMR_CALLBACK callBack
2275  )
2276  Summary:
2277  Sets up an alarm.
2278  <p><b>Implementation:</b> Dynamic</p>
2279  Description:
2280  This function sets up an alarm, allowing the client to receive a callback
2281  from the driver when the timer counter reaches zero. Alarms can be one-shot
2282  or periodic. A periodic alarm will reload the timer and generate alarm
2283  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2284  divider;
2285  Precondition:
2286  The DRV_TMR_Initialize function must have been called.
2287  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2288  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2289  Parameters:
2290  handle - A valid handle, returned from DRV_TMR_Open
2291  divider - The value to divide the timer clock source to obtain the
2292  required alarm frequency.
2293  - a 16 bit value if the timer is configured in 16 bit mode
2294  - a 32 bit value if the timer is configured in 32 bit mode
2295  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2296  context - A reference, call back function will be called with the same
2297  reference.
2298  callBack - A call back function which will be called on time out.
2299  Returns:
2300  - true - if the call succeeded
2301  - false - the obtained divider could not be obtained or the passed handle was invalid
2302  Example:
2303  <code>
2304  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2305  void setupTask ()
2306  {
2307  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2308  uint32_t myFreq = 1000; // 1KHz
2309  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2310  // calculate the divider needed
2311  uint32_t divider = clkFreq / myFreq;
2312  // Start the alarm
2313  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2314  {
2315  // divider value could not be obtain;
2316  // handle the error
2317  //
2318  }
2319  }
2320  </code>
2321  Remarks:
2322  The divider value will be truncated to a 16 bit value if the timer is
2323  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2324  callback.
2325 */
2326 
2327 bool
2329  DRV_HANDLE handle ,
2330  uint32_t divider ,
2331  bool isPeriodic ,
2332  uintptr_t context ,
2333  DRV_TMR_CALLBACK callBack ) ;
2334 // *****************************************************************************
2335 /* Function:
2336  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2337  Summary:
2338  Disables an alarm signal.
2339  <p><b>Implementation:</b> Dynamic</p>
2340  Description:
2341  This function allows the client to disable an alarm generation.
2342  Use DRV_TMR_AlarmEnable to re-enable.
2343  Precondition:
2344  The DRV_TMR_Initialize function must have been called.
2345  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2346  A client alarm must be active.
2347  Parameters:
2348  handle - A valid handle, returned from DRV_TMR_Open
2349  Returns:
2350  The current status of the alarm:
2351  - true if the alarm was currently enabled
2352  - false if the alarm was currently disabled
2353  Example:
2354  <code>
2355  </code>
2356  Remarks:
2357  When the driver operates in interrupts this call resolves to a device
2358  interrupt disable.
2359  Do NOT disable the timer except for very short periods of time. If the time
2360  that the interrupt is disabled is longer than a wrap around period and the
2361  interrupt is missed, the hardware has no means of recovering and the
2362  resulting timing will be inaccurate.
2363 */
2364 
2365 bool
2367  DRV_HANDLE handle ) ;
2368 // *****************************************************************************
2369 /* Function:
2370  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2371  Summary:
2372  Re-enables an alarm signal.
2373  <p><b>Implementation:</b> Dynamic</p>
2374  Description:
2375  This function allows the client to re-enable an alarm after it has been
2376  disabled by a DRV_TMR_AlarmDisable call.
2377  Precondition:
2378  The DRV_TMR_Initialize function must have been called.
2379  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2380  Parameters:
2381  handle - A valid handle, returned from DRV_TMR_Open
2382  enable - boolean to enable the current callback
2383  Returns:
2384  None
2385  Example:
2386  <code>
2387  </code>
2388  Remarks:
2389  When the driver operates in interrupts this call resolves to a device
2390  interrupt re-enable.
2391 */
2392 
2393 void
2395  DRV_HANDLE handle ,
2396  bool enable ) ;
2397 // *****************************************************************************
2398 /* Function:
2399  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2400  Summary:
2401  Updates the Timer's period.
2402  <p><b>Implementation:</b> Dynamic</p>
2403  Description:
2404  This function updates the Timer's period.
2405  Precondition:
2406  The DRV_TMR_Initialize function must have been called.
2407  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2408  Parameters:
2409  handle - A valid open-instance handle, returned from the driver's
2410  open routine
2411  value - Period value
2412  - a 16 bit value if the timer is configured in 16 bit mode
2413  - a 32 bit value if the timer is configured in 32 bit mode
2414  Returns:
2415  None.
2416  Example:
2417  <code>
2418  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2419  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2420  </code>
2421  Remarks:
2422  - The period value will be truncated to a 16 bit value if the timer is
2423  configured in 16 bit mode.
2424 */
2425 
2426 void
2428  DRV_HANDLE handle ,
2429  uint32_t value ) ;
2430 // *****************************************************************************
2431 /* Function:
2432  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2433  Summary:
2434  Provides the Timer's period.
2435  <p><b>Implementation:</b> Dynamic</p>
2436  Description:
2437  This function gets the Timer's period.
2438  Precondition:
2439  The DRV_TMR_Initialize function must have been called.
2440  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2441  Parameters:
2442  handle - A valid open-instance handle, returned from the driver's
2443  open routine
2444  Returns:
2445  Timer period value:
2446  - a 16 bit value if the timer is configured in 16 bit mode
2447  - a 32 bit value if the timer is configured in 32 bit mode
2448  Example:
2449  <code>
2450  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2451  uint32_t period;
2452  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2453  </code>
2454  Remarks:
2455  None.
2456 */
2457 
2458 uint32_t
2460  DRV_HANDLE handle ) ;
2461 // *****************************************************************************
2462 /* Function:
2463  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2464  Summary:
2465  Removes a previously set alarm.
2466  <p><b>Implementation:</b> Dynamic</p>
2467  Description:
2468  This function removes a previously set alarm.
2469  Precondition:
2470  The DRV_TMR_Initialize function must have been called.
2471  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2472  DRV_TMR_AlarmRegister function must have been called before.
2473  Parameters:
2474  handle - A valid open-instance handle, returned from the driver's
2475  open routine
2476  Returns:
2477  None.
2478  Example:
2479  <code>
2480  // Example of a key debounce check
2481  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2482  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2483  void keyPressDetect ()
2484  {
2485  // Calculate the count to be passed on from the clock input
2486  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2487  }
2488  void DebounceCheck ( uintptr_t context )
2489  {
2490  readKey = AppReadKey();
2491  if ( readKey != lastReadKey )
2492  {
2493  lastReadKey = readKey;
2494  keyCount = 0;
2495  }
2496  else
2497  {
2498  if ( keyCount > 20 )
2499  {
2500  globalKeyState = readKey;
2501  DRV_TMR_AlarmDeregister ( tmrHandle );
2502  }
2503  keyCount++;
2504  }
2505  }
2506  </code>
2507  Remarks:
2508  None.
2509 */
2510 
2511 void
2513  DRV_HANDLE handle ) ;
2514 // *****************************************************************************
2515 // *****************************************************************************
2516 // Section: TMR Driver Operation Control Functions
2517 // *****************************************************************************
2518 // *****************************************************************************
2519 // *****************************************************************************
2520 /* Function:
2521  bool DRV_TMR_Start ( DRV_HANDLE handle )
2522  Summary:
2523  Starts the Timer counting.
2524  <p><b>Implementation:</b> Static/Dynamic</p>
2525  Description:
2526  This function starts the Timer counting.
2527  Precondition:
2528  The DRV_TMR_Initialize function must have been called.
2529  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2530  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2531  Parameters:
2532  handle - A valid open-instance handle, returned from the driver's
2533  open routine
2534  Returns:
2535  - true - if the operation succeeded
2536  - false - the supplied handle is invalid or the client doesn't have
2537  the needed parameters to run (alarm callback and period )
2538  Example:
2539  <code>
2540  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2541  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2542  DRV_TMR_Start ( tmrHandle );
2543  </code>
2544  Remarks:
2545  None.
2546 */
2547 
2548 bool
2549  DRV_TMR_Start (
2550  DRV_HANDLE handle ) ;
2551 // *****************************************************************************
2552 /* Function:
2553  void DRV_TMR_Stop ( DRV_HANDLE handle )
2554  Summary:
2555  Stops the Timer from counting.
2556  <p><b>Implementation:</b> Static/Dynamic</p>
2557  Description:
2558  This function stops the running Timer from counting.
2559  Precondition:
2560  The DRV_TMR_Initialize function must have been called.
2561  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2562  Parameters:
2563  handle - A valid open-instance handle, returned from the driver's
2564  open routine
2565  Returns:
2566  None.
2567  Example:
2568  <code>
2569  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2570  DRV_TMR_Stop ( handle );
2571  </code>
2572  Remarks:
2573  None.
2574 */
2575 
2576 void
2577  DRV_TMR_Stop (
2578  DRV_HANDLE handle ) ;
2579 // *****************************************************************************
2580 // *****************************************************************************
2581 // Section: TMR Driver Operation Status Functions
2582 // *****************************************************************************
2583 // *****************************************************************************
2584 // *****************************************************************************
2585 /* Function:
2586  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2587  Summary:
2588  Provides the status of Timer's period elapse.
2589  <p><b>Implementation:</b> Dynamic</p>
2590  Description:
2591  This function returns the number of times Timer's period has elapsed since
2592  last call to this API has made. On calling this API, the internally
2593  maintained counter will be cleared and count will be started again from next
2594  elapse.
2595  Precondition:
2596  The DRV_TMR_Initialize function must have been called.
2597  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2598  Parameters:
2599  handle - A valid handle, returned from the DRV_TMR_Open
2600  Returns:
2601  Number of times timer has elapsed since the last call.
2602  Example:
2603  <code>
2604  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2605  bool elapseStatus;
2606  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2607  unsigned int appInternalTime = 0;
2608  Sys_Tasks()
2609  {
2610  //Timer task will be called from ISR
2611  APP_TimeUpdate_Task();
2612  //Other Tasks
2613  }
2614  void APP_TimeUpdate_Task ( void )
2615  {
2616  //We will not miss a count even though we are late
2617  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2618  }
2619  </code>
2620  Remarks:
2621  None.
2622 */
2623 
2624 uint32_t
2626  DRV_HANDLE handle ) ;
2627 // *****************************************************************************
2628 // *****************************************************************************
2629 // Section: TMR Driver Control and Information Functions
2630 // *****************************************************************************
2631 // *****************************************************************************
2632 // *****************************************************************************
2633 /* Function:
2634  bool DRV_TMR_ClockSet
2635  (
2636  DRV_HANDLE handle,
2637  DRV_TMR_CLK_SOURCES clockSource,
2638  TMR_PRESCALE preScale
2639  )
2640  Summary:
2641  Sets the timers clock by selecting the source and prescaler.
2642  <p><b>Implementation:</b> Dynamic</p>
2643  Description:
2644  This function sets the timer clock by selecting the source and prescaler.
2645  The clock sources are device specific, refer device datasheet for supported
2646  clock sources. If unsupported clock source is passed then the behaviour of
2647  this function is unpredictable.
2648  Precondition:
2649  The DRV_TMR_Initialize function must have been called. Must have selected
2650  32-Bit timer mode if mode selection is applicable.
2651  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2652  Parameters:
2653  handle - A valid open-instance handle, returned from the driver's
2654  open routine
2655  clockSource - Clock source of the timer
2656  preScale - Timer's Prescaler divisor
2657  Returns:
2658  - true - if the operation is successful
2659  - false - either the handle is invalid or the clockSource
2660  and/or prescaler are not supported
2661  Example:
2662  <code>
2663  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2664  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2665  </code>
2666  Remarks:
2667  None.
2668 */
2669 
2670 bool
2672  DRV_HANDLE handle ,
2673  DRV_TMR_CLK_SOURCES clockSource ,
2674  TMR_PRESCALE preScale ) ;
2675 // *****************************************************************************
2676 /* Function:
2677  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2678  Summary:
2679  This function gets the currently selected prescaler.
2680  <p><b>Implementation:</b> Dynamic</p>
2681  Description:
2682  This function gets the currently selected prescaler.
2683  Precondition:
2684  The DRV_TMR_Initialize function must have been called.
2685  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2686  Parameters:
2687  handle - A valid open-instance handle, returned from the driver's
2688  open routine
2689  Returns:
2690  Timer prescaler.
2691  Example:
2692  <code>
2693  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2694  TMR_PRESCALE preScale;
2695  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2696  </code>
2697  Remarks:
2698  None.
2699 */
2700 
2701 TMR_PRESCALE
2703  DRV_HANDLE handle ) ;
2704 // *****************************************************************************
2705 /* Function:
2706  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2707  Summary:
2708  This function gets the currently selected operation mode.
2709  <p><b>Implementation:</b> Dynamic</p>
2710  Description:
2711  This function gets the currently selected 16/32 bit operation mode.
2712  Precondition:
2713  The DRV_TMR_Initialize function must have been called.
2714  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2715  Parameters:
2716  handle - A valid open-instance handle, returned from the driver's
2717  open routine
2718  Returns:
2719  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2720  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2721  handle.
2722  Example:
2723  <code>
2724  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2725  DRV_TMR_OPERATION_MODE operMode;
2726  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2727  </code>
2728  Remarks:
2729  None.
2730 */
2731 
2734  DRV_HANDLE handle ) ;
2735 // *****************************************************************************
2736 /* Function:
2737  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2738  Summary:
2739  Enables the Gate mode.
2740  <p><b>Implementation:</b> Dynamic</p>
2741  Description:
2742  This function enables the Gated mode of Timer. User can measure the duration
2743  of an external signal in this mode. Once the Gate mode is enabled, Timer
2744  will start on the raising edge of the external signal. It will keep counting
2745  until the next falling edge.
2746  Precondition:
2747  The DRV_TMR_Initialize function must have been called.
2748  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2749  Parameters:
2750  handle - A valid open-instance handle, returned from the driver's
2751  open routine
2752  Returns:
2753  - true - if the operation is successful
2754  - false - either the handle is invalid or the gate mode
2755  is not supported
2756  Example:
2757  <code>
2758  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2759  DRV_TMR_GateModeSet ( tmrHandle );
2760  </code>
2761  Remarks:
2762  None.
2763 */
2764 
2765 bool
2767  DRV_HANDLE handle ) ;
2768 // *****************************************************************************
2769 /* Function:
2770  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2771  Summary:
2772  Enables the Gate mode.
2773  <p><b>Implementation:</b> Dynamic</p>
2774  Description:
2775  This function enables the Gated mode of Timer. User can measure the duration
2776  of an external signal in this mode. Once the Gate mode is enabled, Timer
2777  will start on the raising edge of the external signal. It will keep counting
2778  until the next falling edge.
2779  Precondition:
2780  The DRV_TMR_Initialize function must have been called.
2781  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2782  Parameters:
2783  handle - A valid open-instance handle, returned from the driver's
2784  open routine
2785  Returns:
2786  - true - if the operation is successful
2787  - false - either the handle is invalid or the gate mode
2788  is not supported
2789  Example:
2790  <code>
2791  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2792  DRV_TMR_GateModeClear ( tmrHandle );
2793  </code>
2794  Remarks:
2795  None.
2796 */
2797 
2798 bool
2800  DRV_HANDLE handle ) ;
2801 // *****************************************************************************
2802 /* Function:
2803  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2804  Summary:
2805  Provides the Timer input frequency.
2806  <p><b>Implementation:</b> Dynamic</p>
2807  Description:
2808  This function provides the Timer input frequency. Input frequency is the
2809  clock to the Timer register and it is considering the prescaler divisor.
2810  Precondition:
2811  The DRV_TMR_Initialize function must have been called.
2812  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2813  Parameters:
2814  handle - A valid open-instance handle, returned from the driver's
2815  open routine
2816  Returns:
2817  32-bit value corresponding to the running frequency.
2818  If Timer clock source is external, then this function returns 0.
2819  Example:
2820  <code>
2821  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2822  uint32_t clkFreqHz;
2823  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2824  </code>
2825  Remarks:
2826  On most processors, the Timer's base frequency is the same as the peripheral
2827  bus clock.
2828 */
2829 
2830 uint32_t
2832  DRV_HANDLE handle ) ;
2833 // *****************************************************************************
2834 /* Function:
2835  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2836  (
2837  DRV_HANDLE handle,
2838  DRV_TMR_DIVIDER_RANGE* pDivRange
2839  )
2840  Summary:
2841  Returns the Timer divider values.
2842  <p><b>Implementation:</b> Dynamic</p>
2843  Description:
2844  This function provides the Timer operating mode and divider range.
2845  Precondition:
2846  The DRV_TMR_Initialize function must have been called.
2847  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2848  Parameters:
2849  handle - A valid open-instance handle, returned from the driver's
2850  open routine
2851  pDivRange - Address to store the timer divider range.
2852  Returns:
2853  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2854  The pDivRange is updated with the supported range values.
2855  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2856  Example:
2857  <code>
2858  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2859  DRV_TMR_OPERATION_MODE timerMode;
2860  DRV_TMR_DIVIDER_RANGE timerRange;
2861  DRV_TMR_DividerRangeGet(handle, &timerRange);
2862  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2863  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2864  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2865  </code>
2866  Remarks:
2867  None.
2868 */
2869 
2872  DRV_HANDLE handle ,
2873  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2874 // *****************************************************************************
2875 // *****************************************************************************
2876 // Section: File includes for the APIs which are required for backward
2877 // compatibility.
2878 // *****************************************************************************
2879 // *****************************************************************************
2880 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2881 /*******************************************************************************
2882  Timer Device Driver Interface Definition
2883  Company:
2884  Microchip Technology Inc.
2885  File Name:
2886  drv_tmr_compatibility.h
2887  Summary:
2888  Timer device driver interface header file.
2889  Description:
2890  This header file contains macro definition for APIs which will be deprecated
2891  later. This header file is included in drv_tmr.h.
2892 *******************************************************************************/
2893 //DOM-IGNORE-BEGIN
2894 /*******************************************************************************
2895 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2896 Microchip licenses to you the right to use, modify, copy and distribute
2897 Software only when embedded on a Microchip microcontroller or digital signal
2898 controller that is integrated into your product or third party product
2899 (pursuant to the sublicense terms in the accompanying license agreement).
2900 You should refer to the license agreement accompanying this Software for
2901 additional information regarding your rights and obligations.
2902 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2903 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2904 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2905 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2906 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2907 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2908 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2909 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2910 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2911 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2912 *******************************************************************************/
2913 //DOM-IGNORE-END
2914 #ifndef _DRV_TMR_DEPRECATED_H
2915 #define _DRV_TMR_DEPRECATED_H
2916 // *****************************************************************************
2917 // *****************************************************************************
2918 // Section: File includes
2919 // *****************************************************************************
2920 // *****************************************************************************
2921 // *****************************************************************************
2922 /* Function:
2923  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2924  Summary:
2925  Maintains the driver's state machine, processes the events and implements
2926  its ISR.
2927  <p><b>Implementation:</b> Dynamic</p>
2928  Description:
2929  This function is used to maintain the driver's internal state machine and
2930  processes the timer events in interrupt-driven implementations
2931  (DRV_TMR_INTERRUPT_MODE == true).
2932  Precondition:
2933  The DRV_TMR_Initialize function must have been called for the specified Timer
2934  driver instance.
2935  Parameters:
2936  object - Object handle for the specified driver instance (returned from
2937  DRV_TMR_Initialize)
2938  Returns:
2939  None
2940  Example:
2941  <code>
2942  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2943  {
2944  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2945  }
2946  </code>
2947  Remarks:
2948  This function is normally not called directly by an application.
2949  It is called by the timer driver raw ISR.
2950  This function will execute in an ISR context and will never block or access any
2951  resources that may cause it to block.
2952 
2953  This function will be deprecated later, so avoid using it as much as possible.
2954  Use generic function "DRV_TMR_Tasks" instead of this.
2955 */
2956 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2957 // *****************************************************************************
2958 /* Function:
2959  void DRV_TMR_CounterValue16BitSet
2960  (
2961  DRV_HANDLE handle,
2962  uint16_t counterPeriod
2963  )
2964  Summary:
2965  Updates the 16-bit Timer's counter register.
2966  <p><b>Implementation:</b> Dynamic</p>
2967  Description:
2968  This function updates the 16-bit Timer's value in the counter register. This
2969  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2970  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2971  DRV_TMR_CounterValue32BitSet function.
2972  Precondition:
2973  The DRV_TMR_Initialize function must have been called. Must have selected
2974  16-Bit timer mode if mode selection is applicable.
2975  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2976  Parameters:
2977  handle - A valid open-instance handle, returned from the driver's
2978  open routine
2979  counterPeriod - 16-bit counter period value
2980  Returns:
2981  None.
2982  Example:
2983  <code>
2984  //Example to use timer for precision time measurement
2985  //without configuring an alarm (interrupt based)
2986  char appState = 0;
2987  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2988 
2989  switch ( appState )
2990  {
2991  case 0:
2992  //Calculate and set the counter period
2993  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2994 
2995  //counter starts
2996  DRV_TMR_Start ( tmrHandle );
2997 
2998  //Trigger an application operation
2999  app_trigger_operation();
3000 
3001  //Check for time-out in the next state
3002  appState++;
3003  case 1:
3004  //Overflows and stops at 0 if no alarm is set
3005  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3006  {
3007  //Time-out
3008  return false;
3009  }
3010  else if ( app_operation_isComplete( ) )
3011  {
3012  //Operation is complete before time-out
3013  return true;
3014  }
3015  </code>
3016  Remarks:
3017  This function will be deprecated later, so avoid using it as much as possible.
3018  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3019 */
3020 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3021 // *****************************************************************************
3022 /* Function:
3023  void DRV_TMR_CounterValue32BitSet
3024  (
3025  DRV_HANDLE handle,
3026  uint32_t counterPeriod
3027  )
3028  Summary:
3029  Updates the 32-bit Timer's counter register.
3030  <p><b>Implementation:</b> Dynamic</p>
3031  Description:
3032  This function updates the 32-bit Timer's value in the counter register. This
3033  is valid only if the 32-bit mode of the timer is selected Otherwise use
3034  DRV_TMR_CounterValue16BitSet function.
3035  Precondition:
3036  The DRV_TMR_Initialize function must have been called. Must have selected
3037  32-Bit timer mode.
3038  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3039  Parameters:
3040  handle - A valid open-instance handle, returned from the driver's
3041  open routine
3042  counterPeriod - 32-bit counter period value
3043  Returns:
3044  None.
3045  Example:
3046  <code>
3047  //Example to use timer for precision time measurement
3048  //without configuring an alarm (interrupt based)
3049  char appState = 0;
3050  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3051 
3052  switch ( appState )
3053  {
3054  case 0:
3055  //Calculate and set the counter period
3056  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3057 
3058  //counter starts
3059  DRV_TMR_Start ( tmrHandle );
3060 
3061  //Trigger an application operation against which we want to use the time-out
3062  app_trigger_operation();
3063 
3064  //Check for time-out in the next state
3065  appState++;
3066  case 1:
3067  //Overflows and stops at 0 if no alarm is set
3068  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3069  {
3070  //Time-out
3071  return false;
3072  }
3073  else if ( app_operation_isComplete( ) )
3074  {
3075  //Operation is complete before time-out
3076  return true;
3077  }
3078  </code>
3079  Remarks:
3080  In most of the devices only even numbered instances of timer supports
3081  32-bit mode.
3082  This function will be deprecated later, so avoid using it as much as possible.
3083  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3084 */
3085 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3086 // *****************************************************************************
3087 /* Function:
3088  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3089  Summary:
3090  Reads the 16-bit Timer's counter register.
3091  <p><b>Implementation:</b> Dynamic</p>
3092  Description:
3093  This function returns the 16-bit Timer's value in the counter register. This
3094  is valid only if the 16-bit mode of the timer is selected.
3095  Otherwise use DRV_TMR_CounterValue32BitGet function.
3096  Precondition:
3097  The DRV_TMR_Initialize function must have been called. Must have selected
3098  16-Bit timer mode if mode selection is applicable.
3099  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3100  Parameters:
3101  handle - A valid open-instance handle, returned from the driver's
3102  open routine
3103 
3104  Returns:
3105  Timer period in 16-bit mode.
3106  Example:
3107  <code>
3108  //Example to use timer for precision time measurement
3109  //without configuring an alarm (interrupt based)
3110  char appState = 0;
3111  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3112 
3113  switch ( appState )
3114  {
3115  case 0:
3116  //Calculate and set the counter period
3117  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3118 
3119  //counter starts
3120  DRV_TMR_Start ( tmrHandle );
3121 
3122  //Trigger an application operation
3123  app_trigger_operation();
3124 
3125  //Check for time-out in the next state
3126  appState++;
3127  case 1:
3128  //Overflows and stops at 0 if no alarm is set
3129  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3130  {
3131  //Time-out
3132  return false;
3133  }
3134  else if ( app_operation_isComplete( ) )
3135  {
3136  //Operation is complete before time-out
3137  return true;
3138  }
3139  </code>
3140  Remarks:
3141  This function will be deprecated later, so avoid using it as much as possible.
3142  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3143 */
3144 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3145 // *****************************************************************************
3146 /* Function:
3147  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3148  Summary:
3149  Reads the 32-bit Timer's counter register.
3150  <p><b>Implementation:</b> Dynamic</p>
3151  Description:
3152  This function returns the 32-bit Timer's value in the counter register. This
3153  is valid only if the 32-bit mode of the timer is selected Otherwise use
3154  DRV_TMR_CounterValue16BitGet function.
3155  Precondition:
3156  The DRV_TMR_Initialize function must have been called. Must have selected
3157  32-Bit timer mode.
3158  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3159  Parameters:
3160  handle - A valid open-instance handle, returned from the driver's
3161  open routine
3162 
3163  Returns:
3164  32-Bit Counter value.
3165  Example:
3166  <code>
3167  //Example to use timer for precision time measurement
3168  //without configuring an alarm (interrupt based)
3169  char appState = 0;
3170  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3171 
3172  switch ( appState )
3173  {
3174  case 0:
3175  //Calculate and set the counter period
3176  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3177 
3178  //counter starts
3179  DRV_TMR_Start ( tmrHandle );
3180 
3181  //Trigger an application operation
3182  app_trigger_operation();
3183 
3184  //Check for time-out in the next state
3185  appState++;
3186  case 1:
3187  //Overflows and stops at 0 if no alarm is set
3188  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3189  {
3190  //Time-out
3191  return false;
3192  }
3193  else if ( app_operation_isComplete( ) )
3194  {
3195  //Operation is complete before time-out
3196  return true;
3197  }
3198  </code>
3199  Remarks:
3200  In most of the devices only even numbered instances of timer supports
3201  32-bit mode.
3202  This function will be deprecated later, so avoid using it as much as possible.
3203  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3204 */
3205 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3206 // *****************************************************************************
3207 /* Function:
3208  void DRV_TMR_Alarm16BitRegister
3209  (
3210  DRV_HANDLE handle,
3211  uint16_t period,
3212  bool isPeriodic,
3213  uintptr_t context,
3214  DRV_TMR_CALLBACK callBack
3215  )
3216  Summary:
3217  Sets up an alarm.
3218  <p><b>Implementation:</b> Dynamic</p>
3219  Description:
3220  This function sets up an alarm, allowing the client to receive a callback
3221  from the driver when the counter period elapses. Alarms can be one-shot or
3222  periodic. This API is valid only if the 16-bit mode of the timer is
3223  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3224  Precondition:
3225  The DRV_TMR_Initialize function must have been called. Must have selected
3226  16-Bit timer mode if mode selection is applicable.
3227  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3228  Parameters:
3229  handle - A valid handle, returned from DRV_TMR_Open
3230  period - 16-bit period which will be loaded into the Timer hardware register.
3231 
3232  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3233 
3234  context - A reference, call back function will be called with the same
3235  reference.
3236 
3237  callBack - A call back function which will be called on period elapse.
3238 
3239  Returns:
3240  None
3241  Example:
3242  <code>
3243  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3244 
3245  void setupTask ()
3246  {
3247  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3248 
3249  // Calculate the count to be passed on from the clock input
3250  //Periodically toggle LED
3251  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3252  ToggleLedCallBack );
3253  }
3254 
3255  void ToggleLedCallBack ( uintptr_t context )
3256  {
3257  //Toggle
3258  }
3259  </code>
3260  Remarks:
3261  This function will be deprecated later, so avoid using it as much as possible.
3262  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3263 */
3264 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3265 // *****************************************************************************
3266 /* Function:
3267  void DRV_TMR_Alarm32BitRegister
3268  (
3269  DRV_HANDLE handle,
3270  uint32_t period,
3271  bool isPeriodic,
3272  uintptr_t context,
3273  DRV_TMR_CALLBACK callBack
3274  )
3275  Summary:
3276  Sets up an alarm.
3277  <p><b>Implementation:</b> Dynamic</p>
3278  Description:
3279  This function sets up an alarm, allowing the client to receive a callback
3280  from the driver when the counter period elapses. Alarms can be one-shot or
3281  periodic. This API is valid only if the 32-bit mode of the timer is
3282  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3283  Precondition:
3284  The DRV_TMR_Initialize function must have been called. Must have selected
3285  32-Bit timer mode.
3286  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3287  Parameters:
3288  handle - A valid handle, returned from DRV_TMR_Open
3289  period - 32-bit period which will be loaded into the Timer hardware register.
3290 
3291  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3292 
3293  context - A reference, call back function will be called with the same
3294  reference.
3295 
3296  callBack - A call back function which will be called on period elapse.
3297 
3298  Returns:
3299  None
3300  Example:
3301  <code>
3302  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3303 
3304  void setupTask ()
3305  {
3306  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3307 
3308  // Calculate the count to be passed on from the clock input
3309  //Periodically toggle LED
3310  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3311  ToggleLedCallBack );
3312  }
3313 
3314  void ToggleLedCallBack ( uintptr_t context )
3315  {
3316  //Toggle
3317  }
3318  </code>
3319  Remarks:
3320  In most of the devices only even numbered instances of timer supports
3321  32-bit mode.
3322  This function will be deprecated later, so avoid using it as much as possible.
3323  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3324 */
3325 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3326 // *****************************************************************************
3327 /* Function:
3328  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3329  Summary:
3330  Updates the 16-bit Timer's period.
3331  <p><b>Implementation:</b> Dynamic</p>
3332  Description:
3333  This function updates the 16-bit Timer's period. This API is valid only if
3334  the 16-bit mode of the timer is selected
3335  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3336  Precondition:
3337  The DRV_TMR_Initialize function must have been called. Must have selected
3338  16-Bit timer mode if mode selection is applicable.
3339  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3340  Parameters:
3341  handle - A valid open-instance handle, returned from the driver's
3342  open routine
3343  value - 16-bit Period value
3344  Returns:
3345  None.
3346  Example:
3347  <code>
3348  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3349  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3350  </code>
3351  Remarks:
3352  This function will be deprecated later, so avoid using it as much as possible.
3353  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3354 */
3355 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3356 // *****************************************************************************
3357 /* Function:
3358  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3359  Summary:
3360  Updates the 32-bit Timer's period.
3361  <p><b>Implementation:</b> Dynamic</p>
3362  Description:
3363  This function updates the 32-bit Timer's period. This API is valid only if
3364  the 32-bit mode of the timer is selected
3365  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3366  Precondition:
3367  The DRV_TMR_Initialize unction must have been called. Must have selected
3368  32-Bit timer mode.
3369  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3370  Parameters:
3371  handle - A valid open-instance handle, returned from the driver's
3372  open routine
3373  period - 32-bit Period value
3374  Returns:
3375  None.
3376  Example:
3377  <code>
3378  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3379  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3380  </code>
3381  Remarks:
3382  In most of the devices only even numbered instances of timer supports
3383  32-bit mode.
3384  This function will be deprecated later, so avoid using it as much as possible.
3385  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3386 */
3387 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3388 // *****************************************************************************
3389 /* Function:
3390  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3391  Summary:
3392  Provides the 16-bit Timer's period.
3393  <p><b>Implementation:</b> Dynamic</p>
3394  Description:
3395  This function gets the 16-bit Timer's period. This API is valid only if
3396  the 16-bit mode of the timer is selected.
3397  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3398  Precondition:
3399  The DRV_TMR_Initialize function must have been called. Must have selected
3400  16-Bit timer mode if mode selection is applicable.
3401  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3402  Parameters:
3403  handle - A valid open-instance handle, returned from the driver's
3404  open routine
3405  Returns:
3406  16-bit timer period value
3407  Example:
3408  <code>
3409  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3410  uint16_t period;
3411 
3412  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3413  </code>
3414  Remarks:
3415  This function will be deprecated later, so avoid using it as much as possible.
3416  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3417 */
3418 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3419 // *****************************************************************************
3420 /* Function:
3421  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3422  Summary:
3423  Provides the 32-bit Timer's period.
3424  <p><b>Implementation:</b> Dynamic</p>
3425  Description:
3426  This function gets the 32-bit Timer's period. This API is valid only if
3427  the 32-bit mode of the timer is selected
3428  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3429  Precondition:
3430  The DRV_TMR_Initialize function must have been called. Must have selected
3431  32-Bit timer mode.
3432  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3433  Parameters:
3434  handle - A valid open-instance handle, returned from the driver's
3435  open routine
3436  Returns:
3437  32-bit Timer period value.
3438  Example:
3439  <code>
3440  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3441  uint32_t period;
3442  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3443  </code>
3444  Remarks:
3445  In most of the devices only even numbered instances of timer supports
3446  32-bit mode.
3447  This function will be deprecated later, so avoid using it as much as possible.
3448  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3449 */
3450 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3451 // *****************************************************************************
3452 /* Function:
3453  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3454  Summary:
3455  Removes a previously set alarm.
3456  <p><b>Implementation:</b> Dynamic</p>
3457  Description:
3458  This function removes a previously set alarm. This API is valid only if
3459  the 16-bit mode of the timer is selected
3460  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3461  Precondition:
3462  The DRV_TMR_Initialize function must have been called. Must have selected
3463  16-Bit timer mode if mode selection is applicable.
3464  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3465 
3466  DRV_TMR_Alarm16BitRegister function must have been called before.
3467  Parameters:
3468  handle - A valid open-instance handle, returned from the driver's
3469  open routine
3470  Returns:
3471  None.
3472  Example:
3473  <code>
3474  //Example of a key debounce check
3475 
3476  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3477  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3478  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3479 
3480  void keyPressDetect ()
3481  {
3482  // Calculate the count to be passed on from the clock input
3483  //Periodically toggle LED
3484  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3485  DebounceCheck );
3486  }
3487 
3488  void DebounceCheck ( uintptr_t context )
3489  {
3490  readKey = AppReadKey();
3491 
3492  if ( readKey != lastReadKey )
3493  {
3494  lastReadKey = readKey;
3495  keyCount = 0;
3496  }
3497  else
3498  {
3499  if ( keyCount > 20 )
3500  {
3501  globalKeyState = readKey;
3502  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3503  }
3504  keyCount++;
3505  }
3506  }
3507  </code>
3508  Remarks:
3509  This function will be deprecated later, so avoid using it as much as possible.
3510  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3511 */
3512 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3513 // *****************************************************************************
3514 /* Function:
3515  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3516  Summary:
3517  Removes a previously set alarm.
3518  <p><b>Implementation:</b> Dynamic</p>
3519  Description:
3520  This function removes a previously set alarm. This API is valid only if
3521  the 32-bit mode of the timer is selected
3522  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3523  Precondition:
3524  The DRV_TMR_Initialize function must have been called. Must have selected
3525  32-Bit timer mode if mode selection is applicable.
3526  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3527 
3528  DRV_TMR_Alarm32BitRegister function must have been called before.
3529  Parameters:
3530  handle - A valid open-instance handle, returned from the driver's
3531  open routine
3532  Returns:
3533  None.
3534  Example:
3535  <code>
3536  //Example of a key debounce check
3537 
3538  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3539  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3540  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3541 
3542  void keyPressDetect ( void )
3543  {
3544  // Calculate the count to be passed on from the clock input
3545  //Periodically check the key status
3546  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3547  DebounceCheck );
3548  }
3549 
3550  void DebounceCheck ( uintptr_t context )
3551  {
3552  readKey = AppReadKey();
3553 
3554  if ( readKey != lastReadKey )
3555  {
3556  lastReadKey = readKey;
3557  keyCount = 0;
3558  }
3559  else
3560  {
3561  if ( keyCount > 20 )
3562  {
3563  //Key is stable now
3564  globalKeyState = readKey;
3565  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3566  }
3567  keyCount++;
3568  }
3569  }
3570  </code>
3571  Remarks:
3572  In most of the devices only even numbered instances of timer supports
3573  32-bit mode.
3574  This function will be deprecated later, so avoid using it as much as possible.
3575  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3576 */
3577 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3578  // #ifndef _DRV_TMR_DEPRECATED_H
3579 /*******************************************************************************
3580  End of File
3581 */
3582 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3583 /* CLOSE_FILE Include File */
3584 
3585 //DOM-IGNORE-BEGIN
3586 //DOM-IGNORE-END
3587  // #ifndef _DRV_TMR_H
3588 /*******************************************************************************
3589  End of File
3590 */
3591 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3592 /* CLOSE_FILE Include File */
3593 
3594 #include "peripheral/tmr/plib_tmr.h"
3595 #include "peripheral/int/plib_int.h"
3596 // maximum divider value for 32 bit operation mode
3597 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3598 // minimum divider value for 32 bit operation mode
3599 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3600 // maximum divider value for 16 bit operation mode
3601 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3602 // minimum divider value for 16 bit operation mode
3603 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3604 // *****************************************************************************
3605 // *****************************************************************************
3606 // Section: Interface Headers for Instance 0 for the static driver
3607 // *****************************************************************************
3608 // *****************************************************************************
3609 
3610 void
3611  DRV_TMR0_Initialize ( void ) ;
3612 
3613 bool
3614  DRV_TMR0_Start ( void ) ;
3615 
3616 void
3617  DRV_TMR0_Stop ( void ) ;
3618 
3619 static inline void
3621  {
3622  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3623  DRV_TMR0_Stop () ;
3624  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3625  man_59zqendz ( 2 ) ; /* 30 */
3626  }
3627 
3628 static inline SYS_STATUS
3630 {
3631  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3632  /* Return the status as ready always */
3633  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3634  man_59zqendz ( 4 ) ; /* 30 */
3635  return
3636  SYS_STATUS_READY ;
3637 }
3638 
3639 static inline void
3640  DRV_TMR0_Open ( void )
3641  {
3642  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3643  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3644  man_59zqendz ( 6 ) ; /* 30 */
3645  }
3646 
3648  DRV_TMR0_ClientStatus ( void ) ;
3649 
3650 static inline DRV_TMR_OPERATION_MODE
3652 {
3653  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3654  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3655  man_59zqendz ( 8 ) ; /* 30 */
3656  return
3658 }
3659 
3660 static inline void
3662  {
3663  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3664  DRV_TMR0_Stop () ;
3665  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3666  man_59zqendz ( 10 ) ; /* 30 */
3667  }
3668 
3669 bool
3671  DRV_TMR_CLK_SOURCES clockSource ,
3672  TMR_PRESCALE prescale ) ;
3673 
3674 void
3676  uint32_t value ) ;
3677 
3678 uint32_t
3679  DRV_TMR0_CounterValueGet ( void ) ;
3680 
3681 void
3682  DRV_TMR0_CounterClear ( void ) ;
3683 
3684 TMR_PRESCALE
3685  DRV_TMR0_PrescalerGet ( void ) ;
3686 
3687 void
3689  uint32_t value ) ;
3690 
3691 uint32_t
3692  DRV_TMR0_PeriodValueGet ( void ) ;
3693 
3694 void
3695  DRV_TMR0_StopInIdleDisable ( void ) ;
3696 
3697 void
3698  DRV_TMR0_StopInIdleEnable ( void ) ;
3699 
3700 static inline void
3702  {
3703  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3704  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3705  man_59zqendz ( 12 ) ; /* 30 */
3706  }
3707 
3708 uint32_t
3709  DRV_TMR0_CounterFrequencyGet ( void ) ;
3710 
3713  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3714 // *****************************************************************************
3715 // *****************************************************************************
3716 // Section: Interface Headers for Instance 1 for the static driver
3717 // *****************************************************************************
3718 // *****************************************************************************
3719 
3720 void
3721  DRV_TMR1_Initialize ( void ) ;
3722 
3723 bool
3724  DRV_TMR1_Start ( void ) ;
3725 
3726 void
3727  DRV_TMR1_Stop ( void ) ;
3728 
3729 static inline void
3731  {
3732  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3733  DRV_TMR1_Stop () ;
3734  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3735  man_59zqendz ( 14 ) ; /* 30 */
3736  }
3737 
3738 static inline SYS_STATUS
3740 {
3741  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3742  /* Return the status as ready always */
3743  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3744  man_59zqendz ( 16 ) ; /* 30 */
3745  return
3746  SYS_STATUS_READY ;
3747 }
3748 
3749 static inline void
3750  DRV_TMR1_Open ( void )
3751  {
3752  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3753  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3754  man_59zqendz ( 18 ) ; /* 30 */
3755  }
3756 
3758  DRV_TMR1_ClientStatus ( void ) ;
3759 
3760 static inline DRV_TMR_OPERATION_MODE
3762 {
3763  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3764  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3765  man_59zqendz ( 20 ) ; /* 30 */
3766  return
3768 }
3769 
3770 static inline void
3772  {
3773  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3774  DRV_TMR1_Stop () ;
3775  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3776  man_59zqendz ( 22 ) ; /* 30 */
3777  }
3778 
3779 bool
3781  DRV_TMR_CLK_SOURCES clockSource ,
3782  TMR_PRESCALE prescale ) ;
3783 
3784 void
3786  uint32_t value ) ;
3787 
3788 uint32_t
3789  DRV_TMR1_CounterValueGet ( void ) ;
3790 
3791 void
3792  DRV_TMR1_CounterClear ( void ) ;
3793 
3794 TMR_PRESCALE
3795  DRV_TMR1_PrescalerGet ( void ) ;
3796 
3797 void
3799  uint32_t value ) ;
3800 
3801 uint32_t
3802  DRV_TMR1_PeriodValueGet ( void ) ;
3803 
3804 void
3805  DRV_TMR1_StopInIdleDisable ( void ) ;
3806 
3807 void
3808  DRV_TMR1_StopInIdleEnable ( void ) ;
3809 
3810 static inline void
3812  {
3813  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3814  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3815  man_59zqendz ( 24 ) ; /* 30 */
3816  }
3817 
3818 uint32_t
3819  DRV_TMR1_CounterFrequencyGet ( void ) ;
3820 
3823  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3824 // *****************************************************************************
3825 // *****************************************************************************
3826 // Section: Interface Headers for Instance 2 for the static driver
3827 // *****************************************************************************
3828 // *****************************************************************************
3829 
3830 void
3831  DRV_TMR2_Initialize ( void ) ;
3832 
3833 bool
3834  DRV_TMR2_Start ( void ) ;
3835 
3836 void
3837  DRV_TMR2_Stop ( void ) ;
3838 
3839 static inline void
3841  {
3842  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3843  DRV_TMR2_Stop () ;
3844  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3845  man_59zqendz ( 26 ) ; /* 30 */
3846  }
3847 
3848 static inline SYS_STATUS
3850 {
3851  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3852  /* Return the status as ready always */
3853  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3854  man_59zqendz ( 28 ) ; /* 30 */
3855  return
3856  SYS_STATUS_READY ;
3857 }
3858 
3859 static inline void
3860  DRV_TMR2_Open ( void )
3861  {
3862  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3863  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3864  man_59zqendz ( 30 ) ; /* 30 */
3865  }
3866 
3868  DRV_TMR2_ClientStatus ( void ) ;
3869 
3870 static inline DRV_TMR_OPERATION_MODE
3872 {
3873  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3874  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3875  man_59zqendz ( 32 ) ; /* 30 */
3876  return
3878 }
3879 
3880 static inline void
3882  {
3883  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3884  DRV_TMR2_Stop () ;
3885  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3886  man_59zqendz ( 34 ) ; /* 30 */
3887  }
3888 
3889 bool
3891  DRV_TMR_CLK_SOURCES clockSource ,
3892  TMR_PRESCALE prescale ) ;
3893 
3894 void
3896  uint32_t value ) ;
3897 
3898 uint32_t
3899  DRV_TMR2_CounterValueGet ( void ) ;
3900 
3901 void
3902  DRV_TMR2_CounterClear ( void ) ;
3903 
3904 TMR_PRESCALE
3905  DRV_TMR2_PrescalerGet ( void ) ;
3906 
3907 void
3909  uint32_t value ) ;
3910 
3911 uint32_t
3912  DRV_TMR2_PeriodValueGet ( void ) ;
3913 
3914 void
3915  DRV_TMR2_StopInIdleDisable ( void ) ;
3916 
3917 void
3918  DRV_TMR2_StopInIdleEnable ( void ) ;
3919 
3920 static inline void
3922  {
3923  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3924  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3925  man_59zqendz ( 36 ) ; /* 30 */
3926  }
3927 
3928 uint32_t
3929  DRV_TMR2_CounterFrequencyGet ( void ) ;
3930 
3933  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3934 // *****************************************************************************
3935 // *****************************************************************************
3936 // Section: Interface Headers for Instance 3 for the static driver
3937 // *****************************************************************************
3938 // *****************************************************************************
3939 
3940 void
3941  DRV_TMR3_Initialize ( void ) ;
3942 
3943 bool
3944  DRV_TMR3_Start ( void ) ;
3945 
3946 void
3947  DRV_TMR3_Stop ( void ) ;
3948 
3949 static inline void
3951  {
3952  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3953  DRV_TMR3_Stop () ;
3954  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3955  man_59zqendz ( 38 ) ; /* 30 */
3956  }
3957 
3958 static inline SYS_STATUS
3960 {
3961  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3962  /* Return the status as ready always */
3963  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3964  man_59zqendz ( 40 ) ; /* 30 */
3965  return
3966  SYS_STATUS_READY ;
3967 }
3968 
3969 static inline void
3970  DRV_TMR3_Open ( void )
3971  {
3972  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3973  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3974  man_59zqendz ( 42 ) ; /* 30 */
3975  }
3976 
3978  DRV_TMR3_ClientStatus ( void ) ;
3979 
3980 static inline DRV_TMR_OPERATION_MODE
3982 {
3983  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3984  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3985  man_59zqendz ( 44 ) ; /* 30 */
3986  return
3988 }
3989 
3990 static inline void
3992  {
3993  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3994  DRV_TMR3_Stop () ;
3995  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3996  man_59zqendz ( 46 ) ; /* 30 */
3997  }
3998 
3999 bool
4001  DRV_TMR_CLK_SOURCES clockSource ,
4002  TMR_PRESCALE prescale ) ;
4003 
4004 void
4006  uint32_t value ) ;
4007 
4008 uint32_t
4009  DRV_TMR3_CounterValueGet ( void ) ;
4010 
4011 void
4012  DRV_TMR3_CounterClear ( void ) ;
4013 
4014 TMR_PRESCALE
4015  DRV_TMR3_PrescalerGet ( void ) ;
4016 
4017 void
4019  uint32_t value ) ;
4020 
4021 uint32_t
4022  DRV_TMR3_PeriodValueGet ( void ) ;
4023 
4024 void
4025  DRV_TMR3_StopInIdleDisable ( void ) ;
4026 
4027 void
4028  DRV_TMR3_StopInIdleEnable ( void ) ;
4029 
4030 static inline void
4032  {
4033  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4034  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4035  man_59zqendz ( 48 ) ; /* 30 */
4036  }
4037 
4038 uint32_t
4039  DRV_TMR3_CounterFrequencyGet ( void ) ;
4040 
4043  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4044 // *****************************************************************************
4045 // *****************************************************************************
4046 // Section: Interface Headers for Instance 4 for the static driver
4047 // *****************************************************************************
4048 // *****************************************************************************
4049 
4050 void
4051  DRV_TMR4_Initialize ( void ) ;
4052 
4053 bool
4054  DRV_TMR4_Start ( void ) ;
4055 
4056 void
4057  DRV_TMR4_Stop ( void ) ;
4058 
4059 static inline void
4061  {
4062  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4063  DRV_TMR4_Stop () ;
4064  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4065  man_59zqendz ( 50 ) ; /* 30 */
4066  }
4067 
4068 static inline SYS_STATUS
4070 {
4071  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4072  /* Return the status as ready always */
4073  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4074  man_59zqendz ( 52 ) ; /* 30 */
4075  return
4076  SYS_STATUS_READY ;
4077 }
4078 
4079 static inline void
4080  DRV_TMR4_Open ( void )
4081  {
4082  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4083  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4084  man_59zqendz ( 54 ) ; /* 30 */
4085  }
4086 
4088  DRV_TMR4_ClientStatus ( void ) ;
4089 
4090 static inline DRV_TMR_OPERATION_MODE
4092 {
4093  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4094  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4095  man_59zqendz ( 56 ) ; /* 30 */
4096  return
4098 }
4099 
4100 static inline void
4102  {
4103  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4104  DRV_TMR4_Stop () ;
4105  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4106  man_59zqendz ( 58 ) ; /* 30 */
4107  }
4108 
4109 bool
4111  DRV_TMR_CLK_SOURCES clockSource ,
4112  TMR_PRESCALE prescale ) ;
4113 
4114 void
4116  uint32_t value ) ;
4117 
4118 uint32_t
4119  DRV_TMR4_CounterValueGet ( void ) ;
4120 
4121 void
4122  DRV_TMR4_CounterClear ( void ) ;
4123 
4124 TMR_PRESCALE
4125  DRV_TMR4_PrescalerGet ( void ) ;
4126 
4127 void
4129  uint32_t value ) ;
4130 
4131 uint32_t
4132  DRV_TMR4_PeriodValueGet ( void ) ;
4133 
4134 void
4135  DRV_TMR4_StopInIdleDisable ( void ) ;
4136 
4137 void
4138  DRV_TMR4_StopInIdleEnable ( void ) ;
4139 
4140 static inline void
4142  {
4143  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4144  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4145  man_59zqendz ( 60 ) ; /* 30 */
4146  }
4147 
4148 uint32_t
4149  DRV_TMR4_CounterFrequencyGet ( void ) ;
4150 
4153  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4154  // #ifndef _DRV_TMR_STATIC_H
4155 /*******************************************************************************
4156  End of File
4157 */
4158 
4159 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4160 /* CLOSE_FILE Include File */
4161 
4162 #include "peripheral/int/plib_int.h"
4163 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4164 /*******************************************************************************
4165  PMP Driver Interface Declarations for Static Single Instance Driver
4166  Company:
4167  Microchip Technology Inc.
4168  File Name:
4169  drv_pmp_static.h
4170  Summary:
4171  PMP driver interface declarations for the static single instance driver.
4172  Description:
4173  The PMP device driver provides a simple interface to manage the PMP
4174  modules on Microchip microcontrollers. This file defines the interface
4175  Declarations for the PMP driver.
4176 
4177  Remarks:
4178  Static interfaces incorporate the driver instance number within the names
4179  of the routines, eliminating the need for an object ID or object handle.
4180 
4181  Static single-open interfaces also eliminate the need for the open handle.
4182 *******************************************************************************/
4183 //DOM-IGNORE-BEGIN
4184 /*******************************************************************************
4185 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4186 Microchip licenses to you the right to use, modify, copy and distribute
4187 Software only when embedded on a Microchip microcontroller or digital signal
4188 controller that is integrated into your product or third party product
4189 (pursuant to the sublicense terms in the accompanying license agreement).
4190 You should refer to the license agreement accompanying this Software for
4191 additional information regarding your rights and obligations.
4192 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4193 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4194 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4195 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4196 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4197 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4198 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4199 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4200 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4201 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4202 *******************************************************************************/
4203 //DOM-IGNORE-END
4204 #ifndef _DRV_PMP_STATIC_H
4205 #define _DRV_PMP_STATIC_H
4206 #include "peripheral/pmp/plib_pmp.h"
4207 // *****************************************************************************
4208 // *****************************************************************************
4209 // Section: Interface Headers for Instance 0 for the static driver
4210 // *****************************************************************************
4211 // *****************************************************************************
4212 
4213 void
4214  DRV_PMP0_Initialize ( void ) ;
4215 
4216 void
4217  DRV_PMP0_ModeConfig ( void ) ;
4218 
4219 void
4221  PMP_DATA_WAIT_STATES dataWait ,
4222  PMP_STROBE_WAIT_STATES strobeWait ,
4223  PMP_DATA_HOLD_STATES dataHold ) ;
4224 
4225 uint8_t
4226  DRV_PMP0_Read ( void ) ;
4227 
4228 void
4229  DRV_PMP0_Write (
4230  uint8_t data ) ;
4231  // #ifndef _DRV_PMP_STATIC_H
4232 /*******************************************************************************
4233  End of File
4234 */
4235 
4236 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4237 /* CLOSE_FILE Include File */
4238 
4239 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4240 /*******************************************************************************
4241  USART Driver Interface Declarations for Static Single Instance Driver
4242  Company:
4243  Microchip Technology Inc.
4244  File Name:
4245  drv_usart_static.h
4246  Summary:
4247  USART driver interface declarations for the static single instance driver.
4248  Description:
4249  The USART device driver provides a simple interface to manage the USART
4250  modules on Microchip microcontrollers. This file defines the interface
4251  Declarations for the USART static driver.
4252  Remarks:
4253  Static interfaces incorporate the driver instance number within the names
4254  of the routines, eliminating the need for an object ID or object handle.
4255  Static single-open interfaces also eliminate the need for the open handle.
4256 *******************************************************************************/
4257 //DOM-IGNORE-BEGIN
4258 /*******************************************************************************
4259 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4260 Microchip licenses to you the right to use, modify, copy and distribute
4261 Software only when embedded on a Microchip microcontroller or digital signal
4262 controller that is integrated into your product or third party product
4263 (pursuant to the sublicense terms in the accompanying license agreement).
4264 You should refer to the license agreement accompanying this Software for
4265 additional information regarding your rights and obligations.
4266 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4267 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4268 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4269 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4270 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4271 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4272 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4273 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4274 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4275 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4276 *******************************************************************************/
4277 //DOM-IGNORE-END
4278 #ifndef _DRV_USART_STATIC_H
4279 #define _DRV_USART_STATIC_H
4280 // *****************************************************************************
4281 // *****************************************************************************
4282 // Section: Included Files
4283 // *****************************************************************************
4284 // *****************************************************************************
4285 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4286 /*******************************************************************************
4287  USART Driver Local Data Structures for static implementation
4288  Company:
4289  Microchip Technology Inc.
4290  File Name:
4291  drv_usart_static_local.h
4292  Summary:
4293  USART Driver Local Data Structures for static implementation
4294  Description:
4295  Driver Local Data Structures for static implementation
4296 *******************************************************************************/
4297 //DOM-IGNORE-BEGIN
4298 /*******************************************************************************
4299 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4300 Microchip licenses to you the right to use, modify, copy and distribute Software
4301 only when embedded on a Microchip microcontroller or digital signal controller
4302 that is integrated into your product or third party product (pursuant to the
4303 sublicense terms in the accompanying license agreement).
4304 You should refer to the license agreement accompanying this Software for
4305 additional information regarding your rights and obligations.
4306 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4307 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4308 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4309 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4310 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4311 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4312 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4313 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4314 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4315 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4316 *******************************************************************************/
4317 //DOM-IGNORE-END
4318 #ifndef _DRV_USART_STATIC_LOCAL_H
4319 #define _DRV_USART_STATIC_LOCAL_H
4320 // *****************************************************************************
4321 // *****************************************************************************
4322 // Section: Included Files
4323 // *****************************************************************************
4324 // *****************************************************************************
4325 #include <stdint.h>
4326 #include <stdbool.h>
4327 #include <stddef.h>
4328 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4329 /*******************************************************************************
4330  USART Driver Interface Header File
4331  Company:
4332  Microchip Technology Inc.
4333  File Name:
4334  drv_usart.h
4335  Summary:
4336  USART Driver Interface Header File
4337  Description:
4338  The USART device driver provides a simple interface to manage the USART or
4339  UART modules on Microchip microcontrollers. This file provides the
4340  interface definition for the USART driver.
4341 *******************************************************************************/
4342 //DOM-IGNORE-BEGIN
4343 /*******************************************************************************
4344 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4345 Microchip licenses to you the right to use, modify, copy and distribute
4346 Software only when embedded on a Microchip microcontroller or digital signal
4347 controller that is integrated into your product or third party product
4348 (pursuant to the sublicense terms in the accompanying license agreement).
4349 You should refer to the license agreement accompanying this Software for
4350 additional information regarding your rights and obligations.
4351 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4352 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4353 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4354 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4355 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4356 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4357 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4358 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4359 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4360 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4361 *******************************************************************************/
4362 //DOM-IGNORE-END
4363 #ifndef _DRV_USART_H
4364 #define _DRV_USART_H
4365 // *****************************************************************************
4366 // *****************************************************************************
4367 // Section: File includes
4368 // *****************************************************************************
4369 // *****************************************************************************
4370 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4371 /*******************************************************************************
4372  USART Driver Definitions Header File
4373  Company:
4374  Microchip Technology Inc.
4375  File Name:
4376  drv_usart_definitions.h
4377  Summary:
4378  USART Driver Definitions Header File
4379  Description:
4380  This file will provide enumerations and other dependencies needed by
4381  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4382 *******************************************************************************/
4383 //DOM-IGNORE-BEGIN
4384 /*******************************************************************************
4385 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4386 Microchip licenses to you the right to use, modify, copy and distribute
4387 Software only when embedded on a Microchip microcontroller or digital signal
4388 controller that is integrated into your product or third party product
4389 (pursuant to the sublicense terms in the accompanying license agreement).
4390 You should refer to the license agreement accompanying this Software for
4391 additional information regarding your rights and obligations.
4392 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4393 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4394 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4395 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4396 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4397 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4398 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4399 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4400 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4401 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4402 *******************************************************************************/
4403 //DOM-IGNORE-END
4404 #ifndef _DRV_USART_DEFINITIONS_H
4405 #define _DRV_USART_DEFINITIONS_H
4406 // *****************************************************************************
4407 // *****************************************************************************
4408 // Section: File includes
4409 // *****************************************************************************
4410 // *****************************************************************************
4411 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4412 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4413 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4414 /*******************************************************************************
4415  USART Peripheral Library Interface Header
4416  Company:
4417  Microchip Technology Inc.
4418  File Name:
4419  plib_usart.h
4420  Summary:
4421  USART Peripheral Library interface header.
4422  Description:
4423  This header file contains the function prototypes and definitions of
4424  the data types and constants that make up the interface to the USART
4425  Peripheral Library for all families of Microchip microcontrollers. The
4426  functions in this file are common to the USART module.
4427  *******************************************************************************/
4428 // DOM-IGNORE-BEGIN
4429 /*******************************************************************************
4430 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4431 Microchip licenses to you the right to use, modify, copy and distribute
4432 Software only when embedded on a Microchip microcontroller or digital signal
4433 controller that is integrated into your product or third party product
4434 (pursuant to the sublicense terms in the accompanying license agreement).
4435 You should refer to the license agreement accompanying this Software for
4436 additional information regarding your rights and obligations.
4437 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4438 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4439 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4440 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4441 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4442 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4443 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4444 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4445 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4446 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4447  *******************************************************************************/
4448 // DOM-IGNORE-END
4449 #ifndef _PLIB_USART_H
4450 #define _PLIB_USART_H
4451 // DOM-IGNORE-BEGIN
4452 // DOM-IGNORE-END
4453 // ****************************************************************************
4454 // ****************************************************************************
4455 // Section: Included Files
4456 // ****************************************************************************
4457 // ****************************************************************************
4458 /* This section lists the other files that are included in this file.
4459 */
4460 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4461 /*******************************************************************************
4462  Processor Selector File for the USART
4463  Company:
4464  Microchip Technology Incorporated
4465  File Name:
4466  processor.h
4467  Summary:
4468  Selects the appropriate header for the part family
4469  Description:
4470  This file selects the appropriate header for the part family
4471  *******************************************************************************/
4472 // DOM-IGNORE-BEGIN
4473 /*******************************************************************************
4474 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4475 Microchip licenses to you the right to use, modify, copy and distribute
4476 Software only when embedded on a Microchip microcontroller or digital signal
4477 controller that is integrated into your product or third party product
4478 (pursuant to the sublicense terms in the accompanying license agreement).
4479 You should refer to the license agreement accompanying this Software for
4480 additional information regarding your rights and obligations.
4481 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4482 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4483 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4484 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4485 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4486 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4487 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4488 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4489 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4490 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4491  *******************************************************************************/
4492 // DOM-IGNORE-END
4493 #ifndef _USART_PROCESSOR_H
4494 #define _USART_PROCESSOR_H
4495 // *****************************************************************************
4496 // *****************************************************************************
4497 // Section: Included Files
4498 // *****************************************************************************
4499 // *****************************************************************************
4500 /* This section lists the other files that are included in this file.
4501  */
4502 #include <stdint.h>
4503 #include <stdbool.h>
4504 #error "No Processor Family specified"
4505  //
4506  // _USART_PROCESSOR_H
4507 /*******************************************************************************
4508  End of File
4509  */
4510 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4511 /* CLOSE_FILE Include File */
4512 
4513 // ****************************************************************************
4514 // ****************************************************************************
4515 // Section: USART Peripheral Library Interface Functions
4516 // ****************************************************************************
4517 // ****************************************************************************
4518 //******************************************************************************
4519 /* Function:
4520  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4521  Summary:
4522  Enables the USART module to continue to operate when an overflow error
4523  condition has occurred.
4524  Description:
4525  This function enables the USART module to continue to operate when an
4526  overflow error condition has occurred.
4527  This operation is atomic.
4528  Precondition:
4529  None.
4530  Parameters:
4531  index - Identifier for the device instance to be configured
4532  Returns:
4533  None.
4534  Example:
4535  <code>
4536 #define MY_USART_INSTANCE USART_ID_1
4537  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4538  </code>
4539  Remarks:
4540  This feature may not be available on all devices. Please refer to the
4541  specific device data sheet to determine availability or use
4542  PLIB_USART_ExistsRunInOverflow in your application to determine
4543  whether this feature is available.
4544 */
4545 
4546 void
4548  USART_MODULE_ID index ) ;
4549 //******************************************************************************
4550 /* Function:
4551  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4552  Summary:
4553  Disables the Run in overflow condition mode.
4554  Description:
4555  This function disables the USART module from accepting new data when an overflow
4556  error condition is detected.
4557  This operation is atomic.
4558  Precondition:
4559  None.
4560  Parameters:
4561  index - Identifier for the device instance to be configured
4562  Returns:
4563  None.
4564  Example:
4565  <code>
4566 #define MY_USART_INSTANCE USART_ID_1
4567  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4568  </code>
4569  Remarks:
4570  This feature may not be available on all devices. Please refer to the
4571  specific device data sheet to determine availability or use
4572  PLIB_USART_ExistsRunInOverflow in your application to determine
4573  whether this feature is available.
4574 */
4575 
4576 void
4578  USART_MODULE_ID index ) ;
4579 //******************************************************************************
4580 /* Function:
4581  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4582  Summary:
4583  Gets the status of the Run in Overflow condition.
4584  Description:
4585  This function indicates if the USART module has been enabled to run in
4586  an overflow condition.
4587  This operation is atomic.
4588  Precondition:
4589  None.
4590  Parameters:
4591  index - Identifier for the device instance
4592  Returns:
4593  - true - Run in overflow condition is enabled
4594  - false - Run in overflow condition is disabled
4595  Example:
4596  <code>
4597 #define MY_USART_INSTANCE USART_ID_1
4598  bool status;
4599  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4600  </code>
4601  Remarks:
4602  This feature may not be available on all devices. Please refer to the
4603  specific device data sheet to determine availability or use
4604  PLIB_USART_ExistsRunInOverflow in your application to determine
4605  whether this feature is available.
4606 */
4607 
4608 bool
4610  USART_MODULE_ID index ) ;
4611 //******************************************************************************
4612 /* Function:
4613  void PLIB_USART_BRGClockSourceSelect
4614  (
4615  USART_MODULE_ID index,
4616  USART_BRG_CLOCK_SOURCE brgClockSource
4617  )
4618  Summary:
4619  Configures the BRG clock source of the USART module.
4620  Description:
4621  This function configures the BRG Clock source of the USART. Refer to
4622  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4623  Precondition:
4624  None.
4625  Parameters:
4626  index - Identifier for the device instance to be configured
4627  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4628  Returns:
4629  None.
4630  Example:
4631  <code>
4632 #define MY_USART_INSTANCE USART_ID_1
4633  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4634  </code>
4635  Remarks:
4636  This feature may not be available on all devices. Please refer to the
4637  specific device data sheet to determine availability or use
4638  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4639  whether this feature is available.
4640 */
4641 
4642 void
4644  USART_MODULE_ID index ,
4645  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4646 //******************************************************************************
4647 /* Function:
4648  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4649  Summary:
4650  Gets the BRG clock source of the USART module.
4651  Description:
4652  This function returns the BRG Clock source of the USART. Refer to
4653  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4654  This operation is atomic.
4655  Precondition:
4656  None.
4657  Parameters:
4658  index - Identifier for the device instance
4659  Returns:
4660  One of the possible values of USART_BRG_CLOCK_SOURCE
4661  Example:
4662  <code>
4663 #define MY_USART_INSTANCE USART_ID_1
4664  USART_BRG_CLOCK_SOURCE brgClockSource;
4665  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4666  </code>
4667  Remarks:
4668  This feature may not be available on all devices. Please refer to the
4669  specific device data sheet to determine availability or use
4670  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4671  whether this feature is available.
4672 */
4673 
4674 USART_BRG_CLOCK_SOURCE
4676  USART_MODULE_ID index ) ;
4677 //******************************************************************************
4678 /* Function:
4679  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4680  Summary:
4681  Returns the USART module's running status.
4682  Description:
4683  This function checks if the USART module status is busy. The following
4684  functions should not be used when the module status is busy:
4685  - PLIB_USART_LineControlModeSelect
4686  - PLIB_USART_BaudRateHighSet
4687  - PLIB_USART_BaudRateHighEnable
4688  - PLIB_USART_BaudRateHighDisable
4689  - PLIB_USART_ReceiverIdleStateLowEnable
4690  - PLIB_USART_ReceiverIdleStateLowDisable
4691  - PLIB_USART_BaudRateAutoDetectEnable
4692  - PLIB_USART_LoopbackEnable
4693  - PLIB_USART_LoopbackDisable
4694  - PLIB_USART_WakeOnStartEnable
4695  - PLIB_USART_WakeOnStartDisable
4696  - PLIB_USART_OperationModeSelect
4697  - PLIB_USART_HandshakeModeSelect
4698  - PLIB_USART_IrDAEnable
4699  - PLIB_USART_IrDADisable
4700  - PLIB_USART_StopInIdleEnable
4701  - PLIB_USART_StopInIdleDisable
4702  - PLIB_USART_RunInOverflowEnable
4703  - PLIB_USART_RunInOverflowDisable
4704  - PLIB_USART_BRGClockSourceSelect
4705  - PLIB_USART_RunInSleepModeEnable
4706  - PLIB_USART_RunInSleepModeDisable
4707  This operation is atomic.
4708  Precondition:
4709  None.
4710  Parameters:
4711  index - Identifier for the device instance
4712  Returns:
4713  - true - USART module is busy
4714  - false - USART module is idle
4715  Example:
4716  <code>
4717 #define MY_USART_INSTANCE USART_ID_1
4718  bool moduleStatus;
4719  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4720  </code>
4721  Remarks:
4722  This feature may not be available on all devices. Please refer to the
4723  specific device data sheet to determine availability or use
4724  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4725  whether this feature is available.
4726 */
4727 
4728 bool
4730  USART_MODULE_ID index ) ;
4731 //******************************************************************************
4732 /* Function:
4733  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4734  Summary:
4735  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4736  Description:
4737  This function enables the USART module's BRG clock to continue operation when
4738  the device enters the Sleep mode.
4739  This operation is atomic.
4740  Precondition:
4741  None.
4742  Parameters:
4743  index - Identifier for the device instance to be configured
4744  Returns:
4745  None.
4746  Example:
4747  <code>
4748 #define MY_USART_INSTANCE USART_ID_1
4749  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4750  </code>
4751  Remarks:
4752  This feature may not be available on all devices. Please refer to the
4753  specific device data sheet to determine availability or use
4754  PLIB_USART_ExistsRunInSleepMode in your application to determine
4755  whether this feature is available.
4756 */
4757 
4758 void
4760  USART_MODULE_ID index ) ;
4761 //******************************************************************************
4762 /* Function:
4763  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4764  Summary:
4765  Turns off the USART module's BRG clock during Sleep mode.
4766  Description:
4767  This function turns off the USART module's BRG clock during Sleep mode.
4768  This operation is atomic.
4769  Precondition:
4770  None.
4771  Parameters:
4772  index - Identifier for the device instance to be configured
4773  Returns:
4774  None.
4775  Example:
4776  <code>
4777 #define MY_USART_INSTANCE USART_ID_1
4778  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4779  </code>
4780  Remarks:
4781  This feature may not be available on all devices. Please refer to the
4782  specific device data sheet to determine availability or use
4783  PLIB_USART_ExistsRunInSleepMode in your application to determine
4784  whether this feature is available.
4785 */
4786 
4787 void
4789  USART_MODULE_ID index ) ;
4790 //******************************************************************************
4791 /* Function:
4792  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4793  Summary:
4794  Gets the status of Run in Sleep mode.
4795  Description:
4796  This function indicates if the USART module has been enabled to run in
4797  Sleep mode.
4798  This operation is atomic.
4799  Precondition:
4800  None.
4801  Parameters:
4802  index - Identifier for the device instance
4803  Returns:
4804  - true - Run in Sleep mode is enabled
4805  - false - Run in Sleep mode is disabled
4806  Example:
4807  <code>
4808 #define MY_USART_INSTANCE USART_ID_1
4809  bool status;
4810  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4811  </code>
4812  Remarks:
4813  This feature may not be available on all devices. Please refer to the
4814  specific device data sheet to determine availability or use
4815  PLIB_USART_ExistsRunInSleepMode in your application to determine
4816  whether this feature is available.
4817 */
4818 
4819 bool
4821  USART_MODULE_ID index ) ;
4822 //******************************************************************************
4823 /* Function:
4824  void PLIB_USART_Enable ( USART_MODULE_ID index )
4825  Summary:
4826  Enables the specific USART module.
4827  Description:
4828  This function enables the specific USART module.
4829  This operation is atomic.
4830  Precondition:
4831  None.
4832  Parameters:
4833  index - Identifier for the device instance to be configured
4834  Returns:
4835  None.
4836  Example:
4837  <code>
4838 #define MY_USART_INSTANCE USART_ID_1
4839  PLIB_USART_Enable(MY_USART_INSTANCE);
4840  </code>
4841  Remarks:
4842  By calling this function, the USART pins are controlled by the USART
4843  module.
4844  This feature may not be available on all devices. Please refer to the
4845  specific device data sheet to determine availability or use
4846  PLIB_USART_ExistsEnable in your application to determine whether
4847  this feature is available.
4848 */
4849 
4850 void
4852  USART_MODULE_ID index ) ;
4853 //******************************************************************************
4854 /* Function:
4855  void PLIB_USART_Disable ( USART_MODULE_ID index )
4856  Summary:
4857  Disables the specific USART module
4858  Description:
4859  This function disables the specific USART module.
4860  This operation is atomic.
4861  Precondition:
4862  None.
4863  Parameters:
4864  index - Identifier for the device instance to be configured
4865  Returns:
4866  None.
4867  Example:
4868  <code>
4869 #define MY_USART_INSTANCE USART_ID_1
4870  PLIB_USART_Disable(MY_USART_INSTANCE);
4871  </code>
4872  Remarks:
4873  The default state after any reset for a USART module is the disable state.
4874  If the USART is disabled, all of the related pins are in control of the
4875  general purpose I/O logic.
4876 
4877  Disabling the USART module resets the buffers to empty states. Any data
4878  characters in the buffers are lost and the baud rate is reset. All error
4879  and status bits are also reset.
4880 
4881  Disabling the USART while the USART is active, will abort all pending
4882  transmissions and receptions. Re-enabling the USART will restart the
4883  module in the same configuration.
4884 
4885  When disabled, the USART power consumption is minimal.
4886  This feature may not be available on all devices. Please refer to the
4887  specific device data sheet to determine availability or use
4888  PLIB_USART_ExistsEnable in your application to determine whether
4889  this feature is available.
4890 */
4891 
4892 void
4894  USART_MODULE_ID index ) ;
4895 //******************************************************************************
4896 /* Function:
4897  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4898  Summary:
4899  Enables the specific USART module transmitter.
4900  Description:
4901  This function enables the specific USART module transmitter.
4902  This operation is atomic.
4903  Precondition:
4904  The USART module should be enabled using the function PLIB_USART_Enable
4905  before this function is called.
4906  Parameters:
4907  index - Identifier for the device instance to be configured
4908  Returns:
4909  None.
4910  Example:
4911  <code>
4912 #define MY_USART_INSTANCE USART_ID_1
4913  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4914  </code>
4915  Remarks:
4916  The transmitter should not be enabled until the USART is enabled.
4917  The transmissions will not be enabled otherwise.
4918 
4919  This feature may not be available on all devices. Please refer to the
4920  specific device data sheet to determine availability or use
4921  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4922  this feature is available.
4923 */
4924 
4925 void
4927  USART_MODULE_ID index ) ;
4928 //******************************************************************************
4929 /* Function:
4930  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4931  Summary:
4932  Disables the specific USART module transmitter.
4933  Description:
4934  This function disables the specific USART module transmitter.
4935  This operation is atomic.
4936  Precondition:
4937  None.
4938  Parameters:
4939  index - Identifier for the device instance to be configured
4940  Returns:
4941  None.
4942  Example:
4943  <code>
4944 #define MY_USART_INSTANCE USART_ID_1
4945  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4946  </code>
4947  Remarks:
4948  Disabling the transmitter during a transmission will cause the
4949  transmission to be aborted.
4950 
4951  This feature may not be available on all devices. Please refer to the
4952  specific device data sheet to determine availability or use
4953  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4954  this feature is available.
4955 */
4956 
4957 void
4959  USART_MODULE_ID index ) ;
4960 //******************************************************************************
4961 /* Function:
4962  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4963  uint32_t baudRate );
4964  Summary:
4965  Sets the baud rate to the desired value.
4966  Description:
4967  This function sets the baud rate to the desired value.
4968  Precondition:
4969  None.
4970  Parameters:
4971  index - Identifier for the device instance to be configured
4972  baudRate - Baud Rate Value
4973  clockFrequency - Clock Frequency
4974  Returns:
4975  None.
4976  Example:
4977  <code>
4978 #define MY_USART_INSTANCE USART_ID_1
4979  uint32_t baudRateValue ;
4980  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4981  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4982  </code>
4983  Remarks:
4984  Setting a new baud rate value causes the baud rate timer to reset.
4985  This ensures that the baud rate timer does not have to overflow before
4986  outputting the new baud rate.
4987 
4988  If the system clock is changed during an active receive operation, a
4989  receiver error or data loss may result. To avoid this issue verify that
4990  no receptions are in progress before changing the system clock.
4991 
4992  This feature may not be available on all devices. Please refer to the
4993  specific device data sheet to determine availability or use
4994  PLIB_USART_ExistsBaudRate in your application to determine whether
4995  this feature is available.
4996 */
4997 
4998 void
5000  USART_MODULE_ID index ,
5001  uint32_t clockFrequency ,
5002  uint32_t baudRate ) ;
5003 //******************************************************************************
5004 /* Function:
5005  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5006  uint32_t clockFrequency, uint32_t baudRate );
5007  Summary:
5008  Sets the baud rate to the desired value.
5009  Description:
5010  This function sets the baud rate to the desired value.
5011  Precondition:
5012  None.
5013  Parameters:
5014  index - Identifier for the device instance to be configured
5015  baudRate - Baud Rate Value, it is the baud rate value
5016  clockFrequency - Clock Frequency
5017  Returns:
5018  None.
5019  Example:
5020  <code>
5021 #define MY_USART_INSTANCE USART_ID_1
5022  uint32_t baudRateValue ;
5023  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5024  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5025  </code>
5026  Remarks:
5027  Setting a new baud rate value causes the baud rate timer to reset.
5028  This ensures that the baud rate timer does not have to overflow before
5029  outputting the new baud rate.
5030 
5031  If the system clock is changed during an active receive operation, a
5032  receiver error or data loss may result. To avoid this issue verify that
5033  no receptions are in progress before changing the system clock.
5034 
5035  This feature may not be available on all devices. Please refer to the
5036  specific device data sheet to determine availability or use
5037  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5038  this feature is available.
5039 */
5040 
5041 void
5043  USART_MODULE_ID index ,
5044  uint32_t clockFrequency ,
5045  uint32_t baudRate ) ;
5046 //******************************************************************************
5047 /* Function:
5048  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5049  int32_t clockFrequency );
5050  Summary:
5051  Gets the baud rate current in use.
5052  Description:
5053  This function gets the baud rate that is currently in use. The clock frequency
5054  needs to be passed to the function.
5055  Conditions:
5056  None.
5057  Input:
5058  index - Identifier for the device instance to be configured
5059  clockFrequency - Clock Frequency
5060  Returns:
5061  - BaudRate - Baud rate value
5062  Example:
5063  <code>
5064 #define MY_USART_INSTANCE USART_ID_1
5065  uint32_t baudRate ;
5066  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5067  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5068  </code>
5069  Remarks:
5070  This feature may not be available on all devices. Please refer to the
5071  specific device data sheet to determine availability or use
5072  PLIB_USART_ExistsBaudRate in your application to determine whether
5073  this feature is available.
5074 */
5075 
5076 uint32_t
5078  USART_MODULE_ID index ,
5079  int32_t clockFrequency ) ;
5080 //******************************************************************************
5081 /* Function:
5082  void PLIB_USART_AddressSet
5083  (
5084  USART_MODULE_ID index,
5085  uint8_t address
5086  )
5087  Summary:
5088  Sets the address for the Address Detect mode.
5089  Description:
5090  This function sets the address for the Address Detect mode.
5091  This operation is atomic.
5092  Precondition:
5093  None.
5094  Parameters:
5095  index - Identifier for the device instance to be configured
5096  address - Address
5097  Returns:
5098  None.
5099  Example:
5100  <code>
5101 #define MY_USART_INSTANCE USART_ID_1
5102  uint8_t address = 0x02;
5103  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5104  </code>
5105  Remarks:
5106  This feature may not be available on all devices. Please refer to the
5107  specific device data sheet to determine availability or use
5108  PLIB_USART_ExistsReceiverAddress in your application to determine
5109  whether this feature is available.
5110 */
5111 
5112 void
5114  USART_MODULE_ID index ,
5115  uint8_t address ) ;
5116 //******************************************************************************
5117 /* Function:
5118  uint8_t PLIB_USART_AddressGet
5119  (
5120  USART_MODULE_ID index
5121  )
5122  Summary:
5123  Gets the address for the Address Detect mode.
5124  Description:
5125  This function returns the address value being used for the Address
5126  Detect mode.
5127  This operation is atomic.
5128  Precondition:
5129  None.
5130  Parameters:
5131  index - Identifier for the device instance
5132  Returns:
5133  - address - The address being used
5134  Example:
5135  <code>
5136 #define MY_USART_INSTANCE USART_ID_1
5137  uint8_t address = 0;
5138  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5139  </code>
5140  Remarks:
5141  This feature may not be available on all devices. Please refer to the
5142  specific device data sheet to determine availability or use
5143  PLIB_USART_ExistsReceiverAddress in your application to determine
5144  whether this feature is available.
5145 */
5146 
5147 uint8_t
5149  USART_MODULE_ID index ) ;
5150 //******************************************************************************
5151 /* Function:
5152  void PLIB_USART_AddressMaskSet
5153  (
5154  USART_MODULE_ID index,
5155  uint8_t mask
5156  )
5157  Summary:
5158  Sets the address mask for the Address Detect mode.
5159  Description:
5160  This function sets the address mask for the Address Detect mode.
5161  This operation is atomic.
5162  Precondition:
5163  None.
5164  Parameters:
5165  index - Identifier for the device instance to be configured
5166  mask - Address match mask bits
5167  Returns:
5168  None.
5169  Example:
5170  <code>
5171 #define MY_USART_INSTANCE USART_ID_1
5172  uint8_t mask = 0x0F;
5173  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5174  </code>
5175  Remarks:
5176  This feature may not be available on all devices. Please refer to the
5177  specific device data sheet to determine availability or use
5178  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5179  whether this feature is available.
5180 */
5181 
5182 void
5184  USART_MODULE_ID index ,
5185  uint8_t mask ) ;
5186 //******************************************************************************
5187 /* Function:
5188  uint8_t PLIB_USART_AddressMaskGet
5189  (
5190  USART_MODULE_ID index
5191  )
5192  Summary:
5193  Gets the address mask for the Address Detect mode.
5194  Description:
5195  This function returns the address mask value being used for the Address
5196  Detect mode.
5197  This operation is atomic.
5198  Precondition:
5199  None.
5200  Parameters:
5201  index - Identifier for the device instance to be configured
5202  Returns:
5203  - mask - Address mask being used
5204  Example:
5205  <code>
5206 #define MY_USART_INSTANCE USART_ID_1
5207  uint8_t mask = 0;
5208  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5209  </code>
5210  Remarks:
5211  This feature may not be available on all devices. Please refer to the
5212  specific device data sheet to determine availability or use
5213  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5214  whether this feature is available.
5215 */
5216 
5217 uint8_t
5219  USART_MODULE_ID index ) ;
5220 //******************************************************************************
5221 /* Function:
5222  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5223  Summary:
5224  Enables the Address Detect mode.
5225  Description:
5226  This function enables the Address Detect mode. If it is enabled, and the
5227  device is addressed, disable the Address Detect mode to continue receiving
5228  bytes.
5229  This operation is atomic.
5230  Precondition:
5231  None.
5232  Parameters:
5233  index - Identifier for the device instance to be configured
5234  Returns:
5235  None.
5236  Example:
5237  <code>
5238 #define MY_USART_INSTANCE USART_ID_1
5239  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5240  </code>
5241  Remarks:
5242  If 9 data bits are not selected, this bit has no effect.
5243  This feature may not be available on all devices. Please refer to the
5244  specific device data sheet to determine availability or use
5245  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5246  this feature is available.
5247 */
5248 
5249 void
5251  USART_MODULE_ID index ) ;
5252 //******************************************************************************
5253 /* Function:
5254  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5255  Summary:
5256  Enables the Address Detect mode.
5257  Description:
5258  This function disables the Address Detect mode. If it is enabled, and the
5259  device is addressed, disable the Address Detect mode to continue receiving
5260  bytes.
5261  This operation is atomic.
5262  Precondition:
5263  None.
5264  Parameters:
5265  index - Identifier for the device instance to be configured
5266  Returns:
5267  None.
5268  Example:
5269  <code>
5270 #define MY_USART_INSTANCE USART_ID_1
5271  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5272  </code>
5273  Remarks:
5274  All bytes are received, and the 9th bit can be used as the parity bit.
5275  By default, the address detect is disabled.
5276 
5277  This feature may not be available on all devices. Please refer to the
5278  specific device data sheet to determine availability or use
5279  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5280  this feature is available.
5281 */
5282 
5283 void
5285  USART_MODULE_ID index ) ;
5286 //******************************************************************************
5287 /* Function:
5288  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5289  Summary:
5290  Gets the state of the automatic baud detection.
5291  Description:
5292  This function gets the state of the automatic baud detection and returns a '0'
5293  if the baud rate auto detection is complete.
5294  This operation is atomic.
5295  Precondition:
5296  None.
5297  Parameters:
5298  index - Identifier for the device instance to be configured
5299  Returns:
5300  - true - Baud rate detection is not complete
5301  - false - Baud rate detection is complete
5302  Example:
5303  <code>
5304 #define MY_USART_INSTANCE USART_ID_1
5305  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5306  // Wait until the baud rate is detected.
5307  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5308  </code>
5309  Remarks:
5310  This feature may not be available on all devices. Please refer to the
5311  specific device data sheet to determine availability or use
5312  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5313  this feature is available.
5314 */
5315 
5316 bool
5318  USART_MODULE_ID index ) ;
5319 //******************************************************************************
5320 /* Function:
5321  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5322  Summary:
5323  Enables baud rate measurement on the next character, which requires reception
5324  of the Sync character.
5325  Description:
5326  This function enables the baud rate measurement on the next character,
5327  which requires reception of the Sync character.
5328  This operation is atomic.
5329  Precondition:
5330  None.
5331  Parameters:
5332  index - Identifier for the device instance to be configured
5333  Returns:
5334  None.
5335  Example:
5336  <code>
5337 #define MY_USART_INSTANCE USART_ID_1
5338  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5339  // Wait until the baud rate is detected.
5340  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5341  </code>
5342  Remarks:
5343  This feature may not be available on all devices. Please refer to the
5344  specific device data sheet to determine availability or use
5345  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5346  this feature is available.
5347 */
5348 
5349 void
5351  USART_MODULE_ID index ) ;
5352 //******************************************************************************
5353 /* Function:
5354  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5355  Summary:
5356  Data to be transmitted in the Byte mode.
5357  Description:
5358  The data is transmitted in the Byte mode for the specified USART module.
5359  This operation is atomic.
5360  Precondition:
5361  None.
5362  Parameters:
5363  index - Identifier for the device instance to be configured
5364  data - Data to be transmitted.
5365  Returns:
5366  None.
5367  Example:
5368  <code>
5369 #define MY_USART_INSTANCE USART_ID_1
5370  uint8_t data = 'a';
5371  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5372  {
5373  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5374  }
5375  </code>
5376  Remarks:
5377  This feature may not be available on all devices. Please refer to the
5378  specific device data sheet to determine availability or use
5379  PLIB_USART_ExistsTransmitter in your application to determine whether
5380  this feature is available.
5381 */
5382 
5383 void
5385  USART_MODULE_ID index ,
5386  int8_t data ) ;
5387 //******************************************************************************
5388 /* Function:
5389  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5390  Summary:
5391  Data to be received in the Byte mode.
5392  Description:
5393  The data to be received in Byte mode from the specified USART module.
5394  This operation is atomic.
5395  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5396  PLIB_USART_ReceiverParityErrorHasOccurred and
5397  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5398  Precondition:
5399  None.
5400  Parameters:
5401  index - Identifier for the device instance to be configured
5402  Returns:
5403  - data - Data to be received
5404  Example:
5405  <code>
5406 #define MY_USART_INSTANCE USART_ID_1
5407  bool isError;
5408  uint8_t mydata;
5409  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5410  {
5411  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5412  }
5413  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5414  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5415  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5416  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5417  {
5418  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5419  }
5420  </code>
5421  Remarks:
5422  This feature may not be available on all devices. Please refer to the
5423  specific device data sheet to determine availability or use
5424  PLIB_USART_ExistsReceiver in your application to determine whether
5425  this feature is available.
5426 */
5427 
5428 int8_t
5430  USART_MODULE_ID index ) ;
5431 //******************************************************************************
5432 /* Function:
5433  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5434  Summary:
5435  Data to be received in the byte mode with the 9th bit.
5436  Description:
5437  The data to be received in Byte mode from the specified USART module.
5438  with the 9th bit.
5439  This operation is atomic.
5440  Precondition:
5441  None.
5442  Parameters:
5443  index - Identifier for the device instance to be configured
5444  Returns:
5445  - data - Data to be received
5446  Example:
5447  <code>
5448 #define MY_USART_INSTANCE USART_ID_1
5449  uint16_t mydata;
5450  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5451  {
5452  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5453  }
5454  </code>
5455  Remarks:
5456  This feature may not be available on all devices. Please refer to the
5457  specific device data sheet to determine availability or use
5458  PLIB_USART_ExistsReceiver9Bits in your application to determine
5459  whether this feature is available.
5460 */
5461 
5462 int16_t
5464  USART_MODULE_ID index ) ;
5465 //******************************************************************************
5466 /* Function:
5467  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5468  Summary:
5469  Checks and return if the data received is an address.
5470  Description:
5471  Checks and return if the data received is an address. The address has
5472  the 9th bit set. If data received has the 9th bit set, the function returns true;
5473  otherwise, the function returns false.
5474  This operation is atomic.
5475  Precondition:
5476  The USART module should be configured to use the 9 data bits.
5477  Parameters:
5478  index - Identifier for the device instance to be configured
5479  Returns:
5480  - true - if the data received has the 9th bit set
5481  - false - if the address received has the 9th bit cleared
5482  Example:
5483  <code>
5484 #define MY_USART_INSTANCE USART_ID_1
5485  int8_t address;
5486  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5487  {
5488  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5489  }
5490  </code>
5491  Remarks:
5492  This feature may not be available on all devices. Please refer to the
5493  specific device data sheet to determine availability or use
5494  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5495  this feature is available.
5496 */
5497 
5498 bool
5500  USART_MODULE_ID index ) ;
5501 //******************************************************************************
5502 /* Function:
5503  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5504  int8_t data, bool 9thBit )
5505  Summary:
5506  Data to be transmitted in the byte mode with the 9th bit.
5507  Description:
5508  The data is transmitted in the byte mode for the specified USART module,
5509  with 9th bit.
5510  This operation is atomic.
5511  Precondition:
5512  The USART module should be configured to use the 9 data bits.
5513  Parameters:
5514  index - Identifier for the device instance to be configured
5515  data - Data to be transmitted.
5516  9thBit - 9th bit of the data to be transmitted.
5517  Returns:
5518  None.
5519  Example:
5520  <code>
5521 #define MY_USART_INSTANCE USART_ID_1
5522  uint8_t data = 'a';
5523  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5524  {
5525  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5526  }
5527  </code>
5528  Remarks:
5529  This feature may not be available on all devices. Please refer to the
5530  specific device data sheet to determine availability or use
5531  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5532  this feature is available.
5533 */
5534 
5535 void
5537  USART_MODULE_ID index ,
5538  int8_t data ,
5539  bool Bit9th ) ;
5540 //******************************************************************************
5541 /* Function:
5542  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5543  Summary:
5544  Transmits the break character.
5545  Description:
5546  This function transmits the break character.
5547  This operation is atomic.
5548  Precondition:
5549  The application should wait for the transmitter to be idle, before calling
5550  this function.
5551  Parameters:
5552  index - Identifier for the device instance to be configured
5553  Returns:
5554  None.
5555  Example:
5556  <code>
5557 #define MY_USART_INSTANCE USART_ID_1
5558  // Wait for the Transmit buffer to be empty.
5559  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5560  // Transmit the break character.
5561  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5562  // wait for the break transmission to complete
5563  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5564  </code>
5565  Remarks:
5566  After the break has been transmitted, the application can start
5567  transmitting next bytes.
5568 
5569  This feature may not be available on all devices. Please refer to the
5570  specific device data sheet to determine availability or use
5571  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5572  this feature is available.
5573 */
5574 
5575 void
5577  USART_MODULE_ID index ) ;
5578 //******************************************************************************
5579 /* Function:
5580  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5581  Summary:
5582  Returns the status of the break transmission
5583  Description:
5584  The function returns the status of the break transmission.
5585  This operation is atomic.
5586  Precondition:
5587  None.
5588  Parameters:
5589  index - Identifier for the device instance to be configured
5590  Returns:
5591  - true - Transmit break on the next transmission
5592  - false - Break transmission completed or not started
5593  Example:
5594  <code>
5595 #define MY_USART_INSTANCE USART_ID_1
5596  // Wait for the Transmit buffer to be empty.
5597  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5598  // Transmit the break character.
5599  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5600  // wait for the break transmission to complete
5601  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5602  </code>
5603  Remarks:
5604  After the break has been transmitted, the application can start
5605  transmitting next bytes.
5606 
5607  This feature may not be available on all devices. Please refer to the
5608  specific device data sheet to determine availability or use
5609  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5610  this feature is available.
5611 */
5612 
5613 bool
5615  USART_MODULE_ID index ) ;
5616 //******************************************************************************
5617 /* Function:
5618  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5619  Summary:
5620  Identifies if the receive data is available for the specified USART module.
5621  Description:
5622  This function identifies if the receive data is available for the specified
5623  USART module.
5624  This operation is atomic.
5625  Precondition:
5626  None.
5627  Parameters:
5628  index - Identifier for the device instance to be configured
5629  Returns:
5630  - true - The data is available
5631  - false - The data is not available
5632  Example:
5633  <code>
5634 #define MY_USART_INSTANCE USART_ID_1
5635  int8_t mydata;
5636  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5637  {
5638  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5639  }
5640  </code>
5641  Remarks:
5642  This feature may not be available on all devices. Please refer to the
5643  specific device data sheet to determine availability or use
5644  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5645  whether this feature is available.
5646 */
5647 
5648 bool
5650  USART_MODULE_ID index ) ;
5651 //******************************************************************************
5652 /* Function:
5653  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5654  Summary:
5655  Clears a USART vverrun error.
5656  Description:
5657  This function clears an overrun error. Clearing the error, resets the receive buffer.
5658  This operation is atomic.
5659  Precondition:
5660  None.
5661  Parameters:
5662  index - Identifier for the device instance to be configured
5663  Returns:
5664  None.
5665  Example:
5666  <code>
5667 #define MY_USART_INSTANCE USART_ID_1
5668  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5669  {
5670  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5671  }
5672  </code>
5673  Remarks:
5674  WARNING: Calling this API will clear all of the previously received data.
5675 
5676  This feature may not be available on all devices. Please refer to the
5677  specific device data sheet to determine availability or use
5678  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5679  whether this feature is available.
5680 */
5681 
5682 void
5684  USART_MODULE_ID index ) ;
5685 //******************************************************************************
5686 /* Function:
5687  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5688  Summary:
5689  Gets the transmit buffer full status.
5690  Description:
5691  This function gets the transmit status of the specified USART module.
5692  This operation is atomic.
5693  Precondition:
5694  None.
5695  Parameters:
5696  index - Identifier for the device instance to be configured
5697  Returns:
5698  - true - The transmit buffer is full
5699  - false - The transmit buffer is not full, at least one more
5700  character can be written
5701  Example:
5702  <code>
5703 #define MY_USART_INSTANCE USART_ID_1
5704  // Wait for the Transmit buffer to be empty.
5705  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5706  // Transmit the break character.
5707  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5708  </code>
5709  Remarks:
5710  This feature may not be available on all devices. Please refer to the
5711  specific device data sheet to determine availability or use
5712  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5713  whether this feature is available.
5714 */
5715 
5716 bool
5718  USART_MODULE_ID index ) ;
5719 //******************************************************************************
5720 /* Function:
5721  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5722  Summary:
5723  Gets the transmit shift register empty status.
5724  Description:
5725  This function gets the transmit shift register empty status.
5726  This operation is atomic.
5727  Precondition:
5728  None.
5729  Parameters:
5730  index - Identifier for the device instance to be configured
5731  Returns:
5732  - true - The transmit shift register is empty
5733  - false - The transmit shift register is not empty
5734  Example:
5735  <code>
5736 #define MY_USART_INSTANCE USART_ID_1
5737  // Wait for the Transmit buffer to be empty.
5738  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5739  // Transmit the break character.
5740  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5741  </code>
5742  Remarks:
5743  This feature may not be available on all devices. Please refer to the
5744  specific device data sheet to determine availability or use
5745  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5746  whether this feature is available.
5747 */
5748 
5749 bool
5751  USART_MODULE_ID index ) ;
5752 //******************************************************************************
5753 /* Function:
5754  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5755  Summary:
5756  Gets the framing error status.
5757  Description:
5758  This function gets the framing error status.
5759  This operation is atomic.
5760  Precondition:
5761  None.
5762  Parameters:
5763  index - Identifier for the device instance to be configured
5764  Returns:
5765  - true - The framing error was detected on the current character
5766  - false - The framing error was not detected on the current
5767  character
5768  Example:
5769  <code>
5770 #define MY_USART_INSTANCE USART_ID_1
5771  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5772  </code>
5773  Remarks:
5774  Reading the error clears the error.
5775  This feature may not be available on all devices. Please refer to the
5776  specific device data sheet to determine availability or use
5777  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5778  whether this feature is available.
5779 */
5780 
5781 bool
5783  USART_MODULE_ID index ) ;
5784 //******************************************************************************
5785 /* Function:
5786  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5787  Summary:
5788  Gets the parity error status.
5789  Description:
5790  This function gets the parity error status.
5791  This operation is atomic.
5792  Precondition:
5793  None.
5794  Parameters:
5795  index - Identifier for the device instance to be configured
5796  Returns:
5797  - true - The parity error was detected on the current character
5798  - false - The parity error was not detected on the current character
5799  Example:
5800  <code>
5801 #define MY_USART_INSTANCE USART_ID_1
5802  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5803  </code>
5804  Remarks:
5805  Reading the error clears the error.
5806  A Parity error is irrelevant in case of 9-bit mode.
5807  This feature may not be available on all devices. Please refer to the
5808  specific device data sheet to determine availability or use
5809  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5810  whether this feature is available.
5811 */
5812 
5813 bool
5815  USART_MODULE_ID index ) ;
5816 //******************************************************************************
5817 /* Function:
5818  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5819  Summary:
5820  Identifies if there was a receiver overrun error.
5821  Description:
5822  This function identifies if there was a receiver overrun error.
5823  This operation is atomic.
5824  Precondition:
5825  None.
5826  Parameters:
5827  index - Identifier for the device instance to be configured
5828  Returns:
5829  - true - The receive buffer has overflowed
5830  - false - The receive buffer has not overflowed
5831  Example:
5832  <code>
5833 #define MY_USART_INSTANCE USART_ID_1
5834  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5835  {
5836  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5837  }
5838  </code>
5839  Remarks:
5840  This feature may not be available on all devices. Please refer to the
5841  specific device data sheet to determine availability or use
5842  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5843  whether this feature is available.
5844 */
5845 
5846 bool
5848  USART_MODULE_ID index ) ;
5849 //******************************************************************************
5850 /* Function:
5851  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5852  Summary:
5853  Identifies if the receiver is idle.
5854  Description:
5855  This function identifies if the receiver is idle.
5856  This operation is atomic.
5857  Precondition:
5858  None.
5859  Parameters:
5860  index - Identifier for the device instance to be configured
5861  Returns:
5862  - true - The receive buffer is idle
5863  - false - The receive buffer is not idle
5864  Example:
5865  <code>
5866 #define MY_USART_INSTANCE USART_ID_1
5867  int8_t mydata;
5868  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5869  {
5870  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5871  }
5872  </code>
5873  Remarks:
5874  This feature may not be available on all devices. Please refer to the
5875  specific device data sheet to determine availability or use
5876  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5877  whether this feature is available.
5878 */
5879 
5880 bool
5882  USART_MODULE_ID index ) ;
5883 //******************************************************************************
5884 /* Function:
5885  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5886  Summary:
5887  Enables the USART receiver.
5888  Description:
5889  This function enables the USART receiver.
5890  This operation is atomic.
5891  Precondition:
5892  None.
5893  Parameters:
5894  index - Identifier for the device instance to be configured
5895  Returns:
5896  None.
5897  Example:
5898  <code>
5899 #define MY_USART_INSTANCE USART_ID_1
5900  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5901  </code>
5902  Remarks:
5903  This feature may not be available on all devices. Please refer to the
5904  specific device data sheet to determine availability or use
5905  PLIB_USART_ExistsReceiverEnable in your application to determine
5906  whether this feature is available.
5907 */
5908 
5909 void
5911  USART_MODULE_ID index ) ;
5912 //******************************************************************************
5913 /* Function:
5914  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5915  Summary:
5916  Disables the USART receiver.
5917  Description:
5918  This function disables the USART receiver.
5919  This operation is atomic.
5920  Precondition:
5921  None.
5922  Parameters:
5923  index - Identifier for the device instance to be configured
5924  Returns:
5925  None.
5926  Example:
5927  <code>
5928 #define MY_USART_INSTANCE USART_ID_1
5929  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5930  </code>
5931  Remarks:
5932  This feature may not be available on all devices. Please refer to the
5933  specific device data sheet to determine availability or use
5934  PLIB_USART_ExistsReceiverEnable in your application to determine
5935  whether this feature is available.
5936 */
5937 
5938 void
5940  USART_MODULE_ID index ) ;
5941 //******************************************************************************
5942 /* Function:
5943  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5944  Summary:
5945  Enables the Transmit Idle Low state.
5946  Description:
5947  This function enables the Transmit Idle Low state. In the USART Synchronous
5948  mode, this function configures that the TX polarity, the idle state is low.
5949  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5950  state to a '1'.
5951  This operation is atomic.
5952  Precondition:
5953  None.
5954  Parameters:
5955  index - Identifier for the device instance to be configured
5956  Returns:
5957  None.
5958  Example:
5959  <code>
5960 #define MY_USART_INSTANCE USART_ID_1
5961  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5962  </code>
5963  Remarks:
5964  This feature may not be available on all devices. Please refer to the
5965  specific device data sheet to determine availability or use
5966  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5967  whether this feature is available.
5968 */
5969 
5970 void
5972  USART_MODULE_ID index ) ;
5973 //******************************************************************************
5974 /* Function:
5975  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5976  Summary:
5977  Disables the Transmit Idle Low state.
5978  Description:
5979  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5980  this function configures that the TX polarity the idle state is high.
5981  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5982  state to a '0'.
5983  This operation is atomic.
5984  Precondition:
5985  None.
5986  Parameters:
5987  index - Identifier for the device instance to be configured
5988  Returns:
5989  None.
5990  Example:
5991  <code>
5992 #define MY_USART_INSTANCE USART_ID_1
5993  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5994  </code>
5995  Remarks:
5996  This feature may not be available on all devices. Please refer to the
5997  specific device data sheet to determine availability or use
5998  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5999  whether this feature is available.
6000 */
6001 
6002 void
6004  USART_MODULE_ID index ) ;
6005 //******************************************************************************
6006 /* Function:
6007  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6008  Summary:
6009  Enables receive polarity inversion.
6010  Description:
6011  This function enables receive polarity inversion. In the USART Synchronous mode,
6012  this function configures that the data is inverted.
6013  This operation is atomic.
6014  Precondition:
6015  None.
6016  Parameters:
6017  index - Identifier for the device instance to be configured
6018  Returns:
6019  None.
6020  Example:
6021  <code>
6022 #define MY_USART_INSTANCE USART_ID_1
6023  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6024  </code>
6025  Remarks:
6026  This feature may not be available on all devices. Please refer to the
6027  specific device data sheet to determine availability or use
6028  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6029  whether this feature is available.
6030 */
6031 
6032 void
6034  USART_MODULE_ID index ) ;
6035 //******************************************************************************
6036 /* Function:
6037  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6038  Summary:
6039  Disables receive polarity inversion.
6040  This operation is atomic.
6041  Description:
6042  This function disables receive polarity inversion. In the USART Synchronous
6043  mode, this function configures that the data is not inverted.
6044  Precondition:
6045  None.
6046  Parameters:
6047  index - Identifier for the device instance to be configured
6048  Returns:
6049  None.
6050  Example:
6051  <code>
6052 #define MY_USART_INSTANCE USART_ID_1
6053  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6054  </code>
6055  Remarks:
6056  This feature may not be available on all devices. Please refer to the
6057  specific device data sheet to determine availability or use
6058  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6059  whether this feature is available.
6060 */
6061 
6062 void
6064  USART_MODULE_ID index ) ;
6065 //******************************************************************************
6066 /* Function:
6067  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6068  Summary:
6069  Enables high baud rate selection.
6070  Description:
6071  This function enables high baud rate selection.
6072  This operation is atomic.
6073  Precondition:
6074  None.
6075  Parameters:
6076  index - Identifier for the device instance to be configured
6077  Returns:
6078  None.
6079  Example:
6080  <code>
6081 #define MY_USART_INSTANCE USART_ID_1
6082  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6083  </code>
6084  Remarks:
6085  This feature may not be available on all devices. Please refer to the
6086  specific device data sheet to determine availability or use
6087  PLIB_USART_ExistsBaudRateHigh in your application to determine
6088  whether this feature is available.
6089 */
6090 
6091 void
6093  USART_MODULE_ID index ) ;
6094 //******************************************************************************
6095 /* Function:
6096  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6097  Summary:
6098  Disables the high baud rate selection.
6099  Description:
6100  This function disables the high baud rate selection.
6101  This operation is atomic.
6102  Precondition:
6103  None.
6104  Parameters:
6105  index - Identifier for the device instance to be configured
6106  Returns:
6107  None.
6108  Example:
6109  <code>
6110 #define MY_USART_INSTANCE USART_ID_1
6111  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6112  </code>
6113  Remarks:
6114  This feature may not be available on all devices. Please refer to the
6115  specific device data sheet to determine availability or use
6116  PLIB_USART_ExistsBaudRateHigh in your application to determine
6117  whether this feature is available.
6118 */
6119 
6120 void
6122  USART_MODULE_ID index ) ;
6123 //******************************************************************************
6124 /* Function:
6125  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6126  USART_TRANSMIT_INTR_MODE interruptMode )
6127  Summary:
6128  Sets the USART transmitter interrupt mode.
6129  Description:
6130  This function sets the condition in which the USART module should generate
6131  an interrupt.
6132  This operation is atomic.
6133  Precondition:
6134  None.
6135  Parameters:
6136  index - Identifier for the device instance to be configured
6137  interruptMode - Interrupt mode; for possible configurations, refer to
6138  USART_TRANSMIT_INTR_MODE
6139  Returns:
6140  None.
6141  Example:
6142  <code>
6143 #define MY_USART_INSTANCE USART_ID_1
6144  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6145  USART_TRANSMIT_FIFO_EMPTY );
6146  </code>
6147  Remarks:
6148  This feature may not be available on all devices. Please refer to the
6149  specific device data sheet to determine availability or use
6150  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6151  whether this feature is available.
6152 */
6153 
6154 void
6156  USART_MODULE_ID index ,
6157  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6158 //******************************************************************************
6159 /* Function:
6160  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6161  USART_RECEIVE_INTR_MODE interruptMode )
6162  Summary:
6163  Sets the USART receiver FIFO level.
6164  Description:
6165  This function sets the USART receiver FIFO level.
6166  This operation is atomic.
6167  Precondition:
6168  None.
6169  Parameters:
6170  index - Identifier for the device instance to be configured
6171  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6172  Returns:
6173  None.
6174  Example:
6175  <code>
6176 #define MY_USART_INSTANCE USART_ID_1
6177  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6178  USART_RECEIVE_FIFO_ONE_CHAR );
6179  </code>
6180  Remarks:
6181  This feature may not be available on all devices. Please refer to the
6182  specific device data sheet to determine availability or use
6183  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6184  whether this feature is available.
6185 */
6186 
6187 void
6189  USART_MODULE_ID index ,
6190  USART_RECEIVE_INTR_MODE interruptMode ) ;
6191 //******************************************************************************
6192 /* Function:
6193  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6194  USART_LINECONTROL_MODE dataFlowConfig)
6195  Summary:
6196  Sets the data flow configuration.
6197  Description:
6198  This function sets the USART data flow configuration based on the mask
6199  provided and the specified baud rate.
6200  Precondition:
6201  None.
6202  Parameters:
6203  index - Identifier for the device instance to be configured
6204  mode - For possible data flow configurations, refer to
6205  USART_LINECONTROL_MODE
6206  Returns:
6207  None.
6208  Example:
6209  <code>
6210 #define MY_USART_INSTANCE USART_ID_1
6211  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6212  USART_8N1);
6213  </code>
6214  Remarks:
6215  This feature may not be available on all devices. Please refer to the
6216  specific device data sheet to determine availability or use
6217  PLIB_USART_ExistsLineControlMode in your application to determine
6218  whether this feature is available.
6219 */
6220 
6221 void
6223  USART_MODULE_ID index ,
6224  USART_LINECONTROL_MODE dataFlowConfig ) ;
6225 //******************************************************************************
6226 /* Function:
6227  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6228  USART_HANDSHAKE_MODE handshakeConfig)
6229  Summary:
6230  Sets the data flow configuration.
6231  Description:
6232  This function sets the USART data flow configuration based on the mask
6233  provided and the specified baud rate.
6234  Precondition:
6235  None.
6236  Parameters:
6237  index - Identifier for the device instance to be configured
6238  mode - For possible data flow configurations, refer to
6239  USART_HANDSHAKE_MODE
6240  Returns:
6241  None.
6242  Example:
6243  <code>
6244 #define MY_USART_INSTANCE USART_ID_1
6245  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6246  USART_HANDSHAKE_MODE_SIMPLEX);
6247  </code>
6248  Remarks:
6249  This feature may not be available on all devices. Please refer to the
6250  specific device data sheet to determine availability or use
6251  PLIB_USART_ExistsHandshakeMode in your application to determine
6252  whether this feature is available.
6253 */
6254 
6255 void
6257  USART_MODULE_ID index ,
6258  USART_HANDSHAKE_MODE handshakeConfig ) ;
6259 //******************************************************************************
6260 /* Function:
6261  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6262  int8_t Mask)
6263  Summary:
6264  Setup the automatic Address Detect mode.
6265  Description:
6266  This function configures the automatic Address Detect mode. Uses the mask as
6267  the address character for automatic address detection.
6268  This operation is atomic.
6269  Precondition:
6270  None.
6271  Parameters:
6272  index - Identifier for the device instance to be configured
6273  Mask - Address character to be used, when enabled
6274  Returns:
6275  None.
6276  Example:
6277  <code>
6278 #define MY_USART_INSTANCE USART_ID_1
6279  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6280  MY_DEVICE_ADDRESS);
6281  </code>
6282  Remarks:
6283  This feature may not be available on all devices. Please refer to the
6284  specific device data sheet to determine availability or use
6285  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6286  whether this feature is available.
6287 */
6288 
6289 void
6291  USART_MODULE_ID index ,
6292  int8_t Mask ) ;
6293 //******************************************************************************
6294 /* Function:
6295  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6296  USART_MODULE_ID index )
6297  Summary:
6298  Disables the automatic Address Detect mode.
6299  Description:
6300  This function disables the automatic Address Detect mode.
6301  This operation is atomic.
6302  Precondition:
6303  None.
6304  Parameters:
6305  index - Identifier for the device instance to be configured
6306  Returns:
6307  None.
6308  Example:
6309  <code>
6310 #define MY_USART_INSTANCE USART_ID_1
6311  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6312  </code>
6313  Remarks:
6314  This feature may not be available on all devices. Please refer to the
6315  specific device data sheet to determine availability or use
6316  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6317  whether this feature is available.
6318 */
6319 
6320 void
6322  USART_MODULE_ID index ) ;
6323 //******************************************************************************
6324 /* Function:
6325  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6326  Summary:
6327  Enables the IrDA encoder and decoder.
6328  Description:
6329  This function enables the IrDA encoder and decoder.
6330  This operation is atomic.
6331  Precondition:
6332  None.
6333  Parameters:
6334  index - Identifier for the device instance to be configured
6335  Returns:
6336  None.
6337  Example:
6338  <code>
6339 #define MY_USART_INSTANCE USART_ID_1
6340  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6341  </code>
6342  Remarks:
6343  This feature may not be available on all devices. Please refer to the
6344  specific device data sheet to determine availability or use
6345  PLIB_USART_ExistsIrDA in your application to determine
6346  whether this feature is available.
6347 */
6348 
6349 void
6351  USART_MODULE_ID index ) ;
6352 //******************************************************************************
6353 /* Function:
6354  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6355  Summary:
6356  Disables the IrDA encoder and decoder.
6357  Description:
6358  This function disables the IrDA encoder and decoder.
6359  This operation is atomic.
6360  Precondition:
6361  None.
6362  Parameters:
6363  index - Identifier for the device instance to be configured
6364  Returns:
6365  None.
6366  Example:
6367  <code>
6368 #define MY_USART_INSTANCE USART_ID_1
6369  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6370  </code>
6371  Remarks:
6372  By default, the IrDA Encoder and Decoder are disabled.
6373 
6374  This feature may not be available on all devices. Please refer to the
6375  specific device data sheet to determine availability or use
6376  PLIB_USART_ExistsIrDA in your application to determine
6377  whether this feature is available.
6378 */
6379 
6380 void
6382  USART_MODULE_ID index ) ;
6383 //******************************************************************************
6384 /* Function:
6385  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6386  Summary:
6387  Enables Loopback mode.
6388  Description:
6389  This function enables Loopback mode.
6390  This operation is atomic.
6391  Precondition:
6392  None.
6393  Parameters:
6394  index - Identifier for the device instance to be configured
6395  Returns:
6396  None.
6397  Example:
6398  <code>
6399 #define MY_USART_INSTANCE USART_ID_1
6400  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6401  </code>
6402  Remarks:
6403  By default, Loopback mode is disabled.
6404 
6405  This feature may not be available on all devices. Please refer to the
6406  specific device data sheet to determine availability or use
6407  PLIB_USART_ExistsLoopback in your application to determine
6408  whether this feature is available.
6409 */
6410 
6411 void
6413  USART_MODULE_ID index ) ;
6414 //******************************************************************************
6415 /* Function:
6416  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6417  Summary:
6418  Disables Loopback mode.
6419  Description:
6420  This function disables Loopback mode.
6421  This operation is atomic.
6422  Precondition:
6423  None.
6424  Parameters:
6425  index - Identifier for the device instance to be configured
6426  Returns:
6427  None.
6428  Example:
6429  <code>
6430 #define MY_USART_INSTANCE USART_ID_1
6431  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6432  </code>
6433  Remarks:
6434  By default, Loopback mode is disabled.
6435  This feature may not be available on all devices. Please refer to the
6436  specific device data sheet to determine availability or use
6437  PLIB_USART_ExistsLoopback in your application to determine
6438  whether this feature is available.
6439 */
6440 
6441 void
6443  USART_MODULE_ID index ) ;
6444 //******************************************************************************
6445 /* Function:
6446  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6447  USART_OPERATION_MODE operationmode)
6448  Summary:
6449  Configures the operation mode of the USART module.
6450  Description:
6451  This function configures the operation mode of the USART (i.e., controls the
6452  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6453  possible settings.
6454  Precondition:
6455  None.
6456  Parameters:
6457  index - Identifier for the device instance to be configured
6458  operationmode - One of the possible values from USART_OPERATION_MODE
6459  Returns:
6460  None.
6461  Example:
6462  <code>
6463 #define MY_USART_INSTANCE USART_ID_1
6464  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6465  </code>
6466  Remarks:
6467  This feature may not be available on all devices. Please refer to the
6468  specific device data sheet to determine availability or use
6469  PLIB_USART_ExistsOperationMode in your application to determine
6470  whether this feature is available.
6471 */
6472 
6473 void
6475  USART_MODULE_ID index ,
6476  USART_OPERATION_MODE operationmode ) ;
6477 //******************************************************************************
6478 /* Function:
6479  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6480  Summary:
6481  Discontinues operation when the device enters Idle mode.
6482  Description:
6483  This function enables the USART module to discontinue operation when the
6484  device enters Idle mode.
6485  This operation is atomic.
6486  Precondition:
6487  None.
6488  Parameters:
6489  index - Identifier for the device instance to be configured
6490  Returns:
6491  None.
6492  Example:
6493  <code>
6494 #define MY_USART_INSTANCE USART_ID_1
6495  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6496  </code>
6497  Remarks:
6498  This feature may not be available on all devices. Please refer to the
6499  specific device data sheet to determine availability or use
6500  PLIB_USART_ExistsStopInIdle in your application to determine
6501  whether this feature is available.
6502 */
6503 
6504 void
6506  USART_MODULE_ID index ) ;
6507 //******************************************************************************
6508 /* Function:
6509  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6510  Summary:
6511  Disables the Stop in Idle mode (the USART module continues operation when
6512  the device is in Idle mode).
6513  Description:
6514  This function disables the Stop in Idle mode. The USART module continues
6515  operation when the device is in Idle mode.
6516  This operation is atomic.
6517  Precondition:
6518  None.
6519  Parameters:
6520  index - Identifier for the device instance to be configured
6521  Returns:
6522  None.
6523  Example:
6524  <code>
6525 #define MY_USART_INSTANCE USART_ID_1
6526  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6527  </code>
6528  Remarks:
6529  By default, the USART module will continue operation in Idle mode.
6530 
6531  This feature may not be available on all devices. Please refer to the
6532  specific device data sheet to determine availability or use
6533  PLIB_USART_ExistsStopInIdle in your application to determine
6534  whether this feature is available.
6535 */
6536 
6537 void
6539  USART_MODULE_ID index ) ;
6540 //******************************************************************************
6541 /* Function:
6542  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6543  Summary:
6544  Enables the wake-up on start bit detection feature during Sleep mode.
6545  Description:
6546  This function enables the wake-up on start feature during Sleep mode.
6547  This operation is atomic.
6548  Precondition:
6549  None.
6550  Parameters:
6551  index - Identifier for the device instance to be configured
6552  Returns:
6553  None.
6554  Example:
6555  <code>
6556 #define MY_USART_INSTANCE USART_ID_1
6557  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6558  </code>
6559  Remarks:
6560  This feature may not be available on all devices. Please refer to the
6561  specific device data sheet to determine availability or use
6562  PLIB_USART_ExistsWakeOnStart in your application to determine
6563  whether this feature is available.
6564 */
6565 
6566 void
6568  USART_MODULE_ID index ) ;
6569 //******************************************************************************
6570 /* Function:
6571  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6572  Summary:
6573  Disables the wake-up on start bit detection feature during Sleep mode.
6574  Description:
6575  This function disables the wake-up on start bit detection feature during
6576  Sleep mode.
6577  This operation is atomic.
6578  Precondition:
6579  None.
6580  Parameters:
6581  index - Identifier for the device instance to be configured
6582  Returns:
6583  None.
6584  Example:
6585  <code>
6586 #define MY_USART_INSTANCE USART_ID_1
6587  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6588  </code>
6589  Remarks:
6590  This feature may not be available on all devices. Please refer to the
6591  specific device data sheet to determine availability or use
6592  PLIB_USART_ExistsWakeOnStart in your application to determine
6593  whether this feature is available.
6594 */
6595 
6596 void
6598  USART_MODULE_ID index ) ;
6599 //******************************************************************************
6600 /* Function:
6601  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6602  Summary:
6603  Gets the state of the sync break event completion.
6604  Description:
6605  This function returns the status of the sync break event, when called
6606  after enabling using PLIB_USART_WakeOnStartEnable.
6607  This operation is atomic.
6608  Precondition:
6609  None.
6610  Parameters:
6611  index - Identifier for the device instance to be configured
6612  Returns:
6613  None.
6614  Example:
6615  <code>
6616 #define MY_USART_INSTANCE USART_ID_1
6617  //Call the interface just prior to entering the sleep mode.
6618  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6619  // Check the status if the Sync break event is over.
6620  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6621  {
6622  // Do Something
6623  }
6624  </code>
6625  Remarks:
6626  This feature may not be available on all devices. Please refer to the
6627  specific device data sheet to determine availability or use
6628  PLIB_USART_ExistsWakeOnStart in your application to determine
6629  whether this feature is available.
6630 */
6631 
6632 bool
6634  USART_MODULE_ID index ) ;
6635 //******************************************************************************
6636 /* Function:
6637  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6638  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6639  Summary:
6640  Enables or disables general features of the USART module.
6641  Description:
6642  This function enables or disables general features of the USART module.
6643  Precondition:
6644  None.
6645  Parameters:
6646  index - Identifier for the device instance to be configured
6647  autobaud - If true, auto baud rate detection is enabled. If false
6648  the feature is disabled.
6649  loopBackMode - If true, loop back is enabled. If false the feature is
6650  disabled.
6651  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6652  mode on USART activity. If false the feature is disabled.
6653  irdaMode - If true, the IrDA mode is enabled. If false the feature
6654  is disabled.
6655  stopInIdle - If true, module will stop functioning when CPU enters Idle
6656  mode. If false, the feature is disabled.
6657  Returns:
6658  None.
6659  Example:
6660  <code>
6661 #define MY_USART_INSTANCE USART_ID_1
6662  // Enable loopback, disable IrDA, disable auto baud detection and disable
6663  // wake from sleep. Enable stop in idle
6664  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6665  false, false, true);
6666  </code>
6667  Remarks:
6668  Enabling the wake from sleep feature will cause the first character that is
6669  received by the USART module to be discarded. This feature should only be
6670  enabled if the CPU is to placed in power saving mode.
6671 
6672  This feature may not be available on all devices. Please refer to the
6673  specific device data sheet to determine availability. Availability of this
6674  function can also be determined if all of the following functions return
6675  true:
6676  - PLIB_USART_ExistsLoopback
6677  - PLIB_USART_ExistsBaudRateAutoDetect
6678  - PLIB_USART_ExistsWakeOnStart
6679  - PLIB_USART_ExistsIrDA
6680  - PLIB_USART_ExistsStopInIdle
6681 */
6682 
6683 void
6685  USART_MODULE_ID index ,
6686  bool autobaud ,
6687  bool loopBackMode ,
6688  bool wakeFromSleep ,
6689  bool irdaMode ,
6690  bool stopInIdle ) ;
6691 //******************************************************************************
6692 /* Function:
6693  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6694  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6695  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6696  USART_OPERATION_MODE operationMode);
6697  Summary:
6698  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6699  lines to be used by the module.
6700  Description:
6701  This function configures the Receive and Transmit FIFO interrupt levels and
6702  the hardware lines to be used by the module.
6703  Precondition:
6704  None.
6705  Parameters:
6706  index - Identifier for the device instance to be configured
6707  receiveInterruptMode - Receiver FIFO interrupt level
6708  transmitInterruptMode - Transmit FIFO interrupt level
6709  operationMode - Hardware lines to be used by the USART.
6710  Returns:
6711  None.
6712  Example:
6713  <code>
6714 #define MY_USART_INSTANCE USART_ID_1
6715  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6716  // Set Transmit FIFO to interrupt when FIFO is empty
6717  // USART module will only use RX and TX hardware lines
6718  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6719  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6720  </code>
6721  Remarks:
6722  This feature may not be available on all devices. Please refer to the
6723  specific device data sheet to determine availability. Availability of this
6724  function can also be determined if all of the following functions return
6725  true:
6726  - PLIB_USART_ExistsReceiverInterruptMode
6727  - PLIB_USART_ExistsTransmitterInterruptMode
6728  - PLIB_USART_ExistsOperationMode
6729 */
6730 
6731 void
6733  USART_MODULE_ID index ,
6734  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6735  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6736  USART_OPERATION_MODE operationMode ) ;
6737 //******************************************************************************
6738 /* Function:
6739  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6740  clockFrequency, uint32_t baudRate );
6741  Summary:
6742  Sets the baud rate to the desired value and enables the USART receiver,
6743  transmitter and the USART module.
6744  Description:
6745  This function sets the baud rate to the desired value and enables the USART
6746  receiver, USART transmitter and USART module.
6747  Precondition:
6748  None.
6749  Parameters:
6750  index - Identifier for the device instance to be configured
6751  baudRate - Baud Rate Value
6752  clockFrequency - Clock Frequency
6753  Returns:
6754  None.
6755  Example:
6756  <code>
6757 #define MY_USART_INSTANCE USART_ID_1
6758  uint32_t baudRateValue ;
6759  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6760  </code>
6761  Remarks:
6762  Setting a new baud rate value causes the baud rate timer to reset.
6763  This ensures that the baud rate timer does not have to overflow before
6764  outputting the new baud rate.
6765 
6766  If the system clock is changed during an active receive operation, a
6767  receiver error or data loss may result. To avoid this issue verify that
6768  no receptions are in progress before changing the system clock.
6769 
6770  This feature may not be available on all devices. Please refer to the
6771  specific device data sheet to determine availability. Availability of this
6772  function can also be determined if all of the following functions return
6773  true:
6774  - PLIB_USART_ExistsBaudRate
6775  - PLIB_USART_ExistsTransmitterEnable
6776  - PLIB_USART_ExistsReceiverEnable
6777  - PLIB_USART_ExistsEnable
6778 */
6779 
6780 void
6782  USART_MODULE_ID index ,
6783  uint32_t systemClock ,
6784  uint32_t baud ) ;
6785 //******************************************************************************
6786 /* Function:
6787  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6788  Summary:
6789  Return the status of all errors in the specified USART module.
6790  Description:
6791  This function returns status of all errors in the specified USART module.
6792  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6793  status of a specific error.
6794  This operation is atomic.
6795  Precondition:
6796  None.
6797  Parameters:
6798  index - Identifier for the device instance to be configured
6799  Returns:
6800  Returns a bitmap of USART error status.
6801  Example:
6802  <code>
6803 #define MY_USART_INSTANCE USART_ID_1
6804  USART_ERROR error;
6805  // Get the status of all errors.
6806  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6807  // Check if parity error is active
6808  if(error & USART_ERROR_PARITY)
6809  {
6810  // Parity error is active.
6811  }
6812  else if(error & USART_ERROR_FRAMING)
6813  {
6814  // Framing error is active.
6815  }
6816  </code>
6817  Remarks:
6818  This feature may not be available on all devices. Please refer to the
6819  specific device data sheet to determine availability. Availability of this
6820  function can also be determined if all of the followings functions return
6821  true:
6822  - PLIB_USART_ExistsReceiverFramingErrorStatus
6823  - PLIB_USART_ExistsReceiverParityErrorStatus
6824  - PLIB_USART_ExistsReceiverOverrunStatus
6825 */
6826 
6827 USART_ERROR
6829  USART_MODULE_ID index ) ;
6830 //******************************************************************************
6831 /* Function:
6832  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6833  Summary:
6834  Returns the address of the USART TX register
6835  Description:
6836  This function returns the address of the USART TX register.
6837  This operation is atomic.
6838  Preconditions:
6839  None.
6840  Parameters:
6841  index - Identifier for the device instance
6842  Returns:
6843  Address of the USART TX register
6844  Remarks:
6845  None.
6846 */
6847 
6848 void *
6850  USART_MODULE_ID index ) ;
6851 //******************************************************************************
6852 /* Function:
6853  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6854  Summary:
6855  Returns the address of the USART RX register
6856  Description:
6857  This function returns the address of the USART RX register.
6858  This operation is atomic.
6859  Preconditions:
6860  None.
6861  Parameters:
6862  index - Identifier for the device instance
6863  Returns:
6864  Address of the USART RX register
6865  Remarks:
6866  None.
6867 */
6868 
6869 void *
6871  USART_MODULE_ID index ) ;
6872 // *****************************************************************************
6873 // *****************************************************************************
6874 // Section: USART Peripheral Library Exists Functions
6875 // *****************************************************************************
6876 // *****************************************************************************
6877 /* The following functions indicate the existence of the features on the device.
6878 */
6879 //******************************************************************************
6880 /* Function:
6881  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6882  Summary:
6883  Identifies whether the Run in overflow condition feature exists on the USART module.
6884  Description:
6885  This function identifies whether the Run in Overflow condition feature is
6886  available on the USART module. When this function returns true, these
6887  functions are supported on the device:
6888  - PLIB_USART_RunInOverflowEnable
6889  - PLIB_USART_RunInOverflowDisable
6890  - PLIB_USART_RunInOverflowIsEnabled
6891  This operation is atomic.
6892  Preconditions:
6893  None.
6894  Parameters:
6895  index - Identifier for the device instance
6896  Returns:
6897  - true - The Run in Overflow condition feature is supported on the device
6898  - false - The Run in Overflow condition feature is not supported on the device
6899  Remarks:
6900  None.
6901 */
6902 
6903 bool
6905  USART_MODULE_ID index ) ;
6906 //******************************************************************************
6907 /* Function:
6908  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6909  Summary:
6910  Identifies whether the BRG Clock source select feature exists on the
6911  USART module.
6912  Description:
6913  This function identifies whether the BRG Clock source select feature is
6914  available on the USART module. When this function returns true, these
6915  functions are supported on the device:
6916  - PLIB_USART_BRGClockSourceSelect
6917  - PLIB_USART_BRGClockSourceGet
6918  This operation is atomic.
6919  Preconditions:
6920  None.
6921  Parameters:
6922  index - Identifier for the device instance
6923  Returns:
6924  - true - The BRG clock source select feature is supported on the device
6925  - false - The BRG clock source select feature is not supported on the device
6926  Remarks:
6927  None.
6928 */
6929 
6930 bool
6932  USART_MODULE_ID index ) ;
6933 //******************************************************************************
6934 /* Function:
6935  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6936  Summary:
6937  Identifies whether the module running status feature exists on the
6938  USART module.
6939  Description:
6940  This function identifies whether the module running status feature is
6941  available on the USART module. When this function returns true, this
6942  function is supported on the device:
6943  - PLIB_USART_ModuleIsBusy
6944  This operation is atomic.
6945  Preconditions:
6946  None.
6947  Parameters:
6948  index - Identifier for the device instance
6949  Returns:
6950  - true - The Module running status feature is supported on the device
6951  - false - The Module running status feature is not supported on the device
6952  Remarks:
6953  None.
6954 */
6955 
6956 bool
6958  USART_MODULE_ID index ) ;
6959 //******************************************************************************
6960 /* Function:
6961  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6962  Summary:
6963  Identifies whether the Run in Sleep mode feature exists on the USART module.
6964  Description:
6965  This function identifies whether the Run in Sleep mode feature is
6966  available on the USART module. When this function returns true, these
6967  functions are supported on the device:
6968  - PLIB_USART_RunInSleepModeEnable
6969  - PLIB_USART_RunInSleepModeDisable
6970  - PLIB_USART_RunInSleepModeIsEnabled
6971  This operation is atomic.
6972  Preconditions:
6973  None.
6974  Parameters:
6975  index - Identifier for the device instance
6976  Returns:
6977  - true - The Run in Sleep mode feature is supported on the device
6978  - false - The Run in Sleep mode feature is not supported on the device
6979  Remarks:
6980  None.
6981 */
6982 
6983 bool
6985  USART_MODULE_ID index ) ;
6986 //******************************************************************************
6987 /* Function:
6988  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6989  Summary:
6990  Identifies whether the EnableControl feature exists on the USART module.
6991  Description:
6992  This function identifies whether the EnableControl feature is
6993  available on the USART module. When this function returns true, these
6994  functions are supported on the device:
6995  - PLIB_USART_Disable
6996  - PLIB_USART_Enable
6997  This operation is atomic.
6998  Preconditions:
6999  None.
7000  Parameters:
7001  index - Identifier for the device instance
7002  Returns:
7003  - true - The EnableControl feature is supported on the device
7004  - false - The EnableControl feature is not supported on the device
7005  Remarks:
7006  None.
7007 */
7008 
7009 bool
7011  USART_MODULE_ID index ) ;
7012 //******************************************************************************
7013 /* Function:
7014  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7015  Summary:
7016  Identifies whether the HandShakeMode feature exists on the USART module.
7017  Description:
7018  This function identifies whether the HandShakeMode feature is
7019  available on the USART module. When this function returns true, this
7020  function is supported on the device:
7021  - PLIB_USART_HandshakeModeSelect
7022  This operation is atomic.
7023  Preconditions:
7024  None.
7025  Parameters:
7026  index - Identifier for the device instance
7027  Returns:
7028  - true - The HandShakeMode feature is supported on the device
7029  - false - The HandShakeMode feature is not supported on the device
7030  Remarks:
7031  None.
7032 */
7033 
7034 bool
7036  USART_MODULE_ID index ) ;
7037 //******************************************************************************
7038 /* Function:
7039  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7040  Summary:
7041  Identifies whether the IrDAControl feature exists on the USART module.
7042  Description:
7043  This function identifies whether the IrDAControl feature is
7044  available on the USART module. When this function returns true, these
7045  functions are supported on the device:
7046  - PLIB_USART_IrDADisable
7047  - PLIB_USART_IrDAEnable
7048  This operation is atomic.
7049  Preconditions:
7050  None.
7051  Parameters:
7052  index - Identifier for the device instance
7053  Returns:
7054  - true - The IrDAControl feature is supported on the device
7055  - false - The IrDAControl feature is not supported on the device
7056  Remarks:
7057  None.
7058 */
7059 
7060 bool
7062  USART_MODULE_ID index ) ;
7063 //******************************************************************************
7064 /* Function:
7065  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7066  Summary:
7067  Identifies whether the LineControlMode feature exists on the USART module.
7068  Description:
7069  This function identifies whether the LineControlMode feature is
7070  available on the USART module. When this function returns true, this
7071  function is supported on the device:
7072  - PLIB_USART_LineControlModeSelect
7073  This operation is atomic.
7074  Preconditions:
7075  None.
7076  Parameters:
7077  index - Identifier for the device instance
7078  Returns:
7079  - true - The LineControlMode feature is supported on the device
7080  - false - The LineControlMode feature is not supported on the device
7081  Remarks:
7082  None.
7083 */
7084 
7085 bool
7087  USART_MODULE_ID index ) ;
7088 //******************************************************************************
7089 /* Function:
7090  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7091  Summary:
7092  Identifies whether the Loopback feature exists on the USART module.
7093  Description:
7094  This function identifies whether the Loopback feature is
7095  available on the USART module. When this function returns true, these
7096  functions are supported on the device:
7097  - PLIB_USART_LoopbackEnable
7098  - PLIB_USART_LoopbackDisable
7099  This operation is atomic.
7100  Preconditions:
7101  None.
7102  Parameters:
7103  index - Identifier for the device instance
7104  Returns:
7105  - true - The Loopback feature is supported on the device
7106  - false - The Loopback feature is not supported on the device
7107  Remarks:
7108  None.
7109 */
7110 
7111 bool
7113  USART_MODULE_ID index ) ;
7114 //******************************************************************************
7115 /* Function:
7116  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7117  Summary:
7118  Identifies whether the OperationMode feature exists on the USART module.
7119  Description:
7120  This function identifies whether the OperationMode feature is
7121  available on the USART module. When this function returns true, this
7122  function is supported on the device:
7123  - PLIB_USART_OperationModeSelect
7124  This operation is atomic.
7125  Preconditions:
7126  None.
7127  Parameters:
7128  index - Identifier for the device instance
7129  Returns:
7130  - true - The OperationMode feature is supported on the device
7131  - false - The OperationMode feature is not supported on the device
7132  Remarks:
7133  None.
7134 */
7135 
7136 bool
7138  USART_MODULE_ID index ) ;
7139 //******************************************************************************
7140 /* Function:
7141  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7142  Summary:
7143  Identifies whether the StopInIdle feature exists on the USART module.
7144  Description:
7145  This function identifies whether the StopInIdle feature is
7146  available on the USART module. When this function returns true, these
7147  functions are supported on the device:
7148  - PLIB_USART_StopInIdleEnable
7149  - PLIB_USART_StopInIdleDisable
7150  This operation is atomic.
7151  Preconditions:
7152  None.
7153  Parameters:
7154  index - Identifier for the device instance
7155  Returns:
7156  - true - The StopInIdle feature is supported on the device
7157  - false - The StopInIdle feature is not supported on the device
7158  Remarks:
7159  None.
7160 */
7161 
7162 bool
7164  USART_MODULE_ID index ) ;
7165 //******************************************************************************
7166 /* Function:
7167  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7168  Summary:
7169  Identifies whether the WakeOnStart feature exists on the USART module.
7170  Description:
7171  This function identifies whether the WakeOnStart feature is
7172  available on the USART module. When this function returns true, these
7173  functions are supported on the device:
7174  - PLIB_USART_WakeOnStartEnable
7175  - PLIB_USART_WakeOnStartDisable
7176  - PLIB_USART_WakeOnStartIsEnabled
7177  This operation is atomic.
7178  Preconditions:
7179  None.
7180  Parameters:
7181  index - Identifier for the device instance
7182  Returns:
7183  - true - The WakeOnStart feature is supported on the device
7184  - false - The WakeOnStart feature is not supported on the device
7185  Remarks:
7186  None.
7187 */
7188 
7189 bool
7191  USART_MODULE_ID index ) ;
7192 //******************************************************************************
7193 /* Function:
7194  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7195  Summary:
7196  Identifies whether the BaudRate feature exists on the USART module.
7197  Description:
7198  This function identifies whether the BaudRate feature is
7199  available on the USART module. When this function returns true, these
7200  functions are supported on the device:
7201  - PLIB_USART_BaudRateSet
7202  - PLIB_USART_BaudRateGet
7203  This operation is atomic.
7204  Preconditions:
7205  None.
7206  Parameters:
7207  index - Identifier for the device instance
7208  Returns:
7209  - true - The BaudRate feature is supported on the device
7210  - false - The BaudRate feature is not supported on the device
7211  Remarks:
7212  None.
7213 */
7214 
7215 bool
7217  USART_MODULE_ID index ) ;
7218 //******************************************************************************
7219 /* Function:
7220  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7221  Summary:
7222  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7223  Description:
7224  This function identifies whether the BaudRateAutoDetect feature is
7225  available on the USART module. When this function returns true, these
7226  functions are supported on the device:
7227  - PLIB_USART_BaudRateAutoDetectEnable
7228  - PLIB_USART_BaudRateAutoDetectIsComplete
7229  This operation is atomic.
7230  Preconditions:
7231  None.
7232  Parameters:
7233  index - Identifier for the device instance
7234  Returns:
7235  - true - The BaudRateAutoDetect feature is supported on the device
7236  - false - The BaudRateAutoDetect feature is not supported on the device
7237  Remarks:
7238  None.
7239 */
7240 
7241 bool
7243  USART_MODULE_ID index ) ;
7244 //******************************************************************************
7245 /* Function:
7246  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7247  Summary:
7248  Identifies whether the BaudRateHigh feature exists on the USART module.
7249  Description:
7250  This function identifies whether the BaudRateHigh feature is
7251  available on the USART module. When this function returns true, these
7252  functions are supported on the device:
7253  - PLIB_USART_BaudRateHighSet
7254  - PLIB_USART_BaudRateHighDisable
7255  - PLIB_USART_BaudRateHighEnable
7256  This operation is atomic.
7257  Preconditions:
7258  None.
7259  Parameters:
7260  index - Identifier for the device instance
7261  Returns:
7262  - true - The BaudRateHigh feature is supported on the device
7263  - false - The BaudRateHigh feature is not supported on the device
7264  Remarks:
7265  None.
7266 */
7267 
7268 bool
7270  USART_MODULE_ID index ) ;
7271 //******************************************************************************
7272 /* Function:
7273  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7274  Summary:
7275  Identifies whether the Receiver Address feature exists on the USART
7276  module.
7277  Description:
7278  This function identifies whether the Receiver Address feature is
7279  available on the USART module. When this function returns true, these
7280  functions are supported on the device:
7281  - PLIB_USART_AddressSet
7282  - PLIB_USART_AddressGet
7283  This operation is atomic.
7284  Preconditions:
7285  None.
7286  Parameters:
7287  index - Identifier for the device instance
7288  Returns:
7289  - true - The Receiver address feature is supported on the device
7290  - false - The Receiver address feature is not supported on the device
7291  Remarks:
7292  None.
7293 */
7294 
7295 bool
7297  USART_MODULE_ID index ) ;
7298 //******************************************************************************
7299 /* Function:
7300  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7301  Summary:
7302  Identifies whether the Receiver Address Mask feature exists on the USART
7303  module.
7304  Description:
7305  This function identifies whether the Receiver Address Mask feature is
7306  available on the USART module. When this function returns true, these
7307  functions are supported on the device:
7308  - PLIB_USART_AddressMaskSet
7309  - PLIB_USART_AddressMaskGet
7310  This operation is atomic.
7311  Preconditions:
7312  None.
7313  Parameters:
7314  index - Identifier for the device instance
7315  Returns:
7316  - true - The Receiver address mask feature is supported on the device
7317  - false - The Receiver address mask feature is not supported on the device
7318  Remarks:
7319  None.
7320 */
7321 
7322 bool
7324  USART_MODULE_ID index ) ;
7325 //******************************************************************************
7326 /* Function:
7327  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7328  Summary:
7329  Identifies whether the Receiver feature exists on the USART module.
7330  Description:
7331  This function identifies whether the Receiver feature is available on the
7332  USART module. When this function returns true, these functions are supported
7333  on the device:
7334  - PLIB_USART_ReceiverByteReceive
7335  - PLIB_USART_ReceiverAddressGet
7336  This operation is atomic.
7337  Preconditions:
7338  None.
7339  Parameters:
7340  index - Identifier for the device instance
7341  Returns:
7342  - true - The Receiver feature is supported on the device
7343  - false - The Receiver feature is not supported on the device
7344  Remarks:
7345  None.
7346 */
7347 
7348 bool
7350  USART_MODULE_ID index ) ;
7351 //******************************************************************************
7352 /* Function:
7353  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7354  Summary:
7355  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7356  Description:
7357  This function identifies whether the 9 Bits Receiver feature is available on the
7358  USART module. When this function returns true, this function is supported
7359  on the device:
7360  - PLIB_USART_Receiver9BitsReceive
7361  This operation is atomic.
7362  Preconditions:
7363  None.
7364  Parameters:
7365  index - Identifier for the device instance
7366  Returns:
7367  - true - The feature is supported on the device
7368  - false - The feature is not supported on the device
7369  Remarks:
7370  None.
7371 */
7372 
7373 bool
7375  USART_MODULE_ID index ) ;
7376 //******************************************************************************
7377 /* Function:
7378  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7379  Summary:
7380  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7381  Description:
7382  This function identifies whether the ReceiverAddressAutoDetect feature is
7383  available on the USART module. When this function returns true, these
7384  functions are supported on the device:
7385  - PLIB_USART_ReceiverAddressAutoDetectEnable
7386  - PLIB_USART_ReceiverAddressAutoDetectDisable
7387  This operation is atomic.
7388  Preconditions:
7389  None.
7390  Parameters:
7391  index - Identifier for the device instance
7392  Returns:
7393  - true - The ReceiverAddressAutoDetect feature is supported on the device
7394  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7395  Remarks:
7396  None.
7397 */
7398 
7399 bool
7401  USART_MODULE_ID index ) ;
7402 //******************************************************************************
7403 /* Function:
7404  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7405  Summary:
7406  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7407  Description:
7408  This function identifies whether the ReceiverAddressDetect feature is
7409  available on the USART module. When this function returns true, these
7410  functions are supported on the device:
7411  - PLIB_USART_ReceiverAddressDetectEnable
7412  - PLIB_USART_ReceiverAddressDetectDisable
7413  - PLIB_USART_ReceiverAddressIsReceived
7414  This operation is atomic.
7415  Preconditions:
7416  None.
7417  Parameters:
7418  index - Identifier for the device instance
7419  Returns:
7420  - true - The ReceiverAddressDetect feature is supported on the device
7421  - false - The ReceiverAddressDetect feature is not supported on the device
7422  Remarks:
7423  None.
7424 */
7425 
7426 bool
7428  USART_MODULE_ID index ) ;
7429 //******************************************************************************
7430 /* Function:
7431  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7432  Summary:
7433  Identifies whether the ReceiverDataAvailable feature exists on the USART
7434  module
7435  Description:
7436  This function identifies whether the ReceiverDataAvailable feature is
7437  available on the USART module. When this function returns true, this
7438  function is supported on the device:
7439  - PLIB_USART_ReceiverDataIsAvailable
7440  This operation is atomic.
7441  Preconditions:
7442  None.
7443  Parameters:
7444  index - Identifier for the device instance
7445  Returns:
7446  - true - The ReceiverDataAvailable feature is supported on the device
7447  - false - The ReceiverDataAvailable feature is not supported on the device
7448  Remarks:
7449  None.
7450 */
7451 
7452 bool
7454  USART_MODULE_ID index ) ;
7455 //******************************************************************************
7456 /* Function:
7457  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7458  Summary:
7459  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7460  Description:
7461  This function identifies whether the ReceiverEnableControl feature is
7462  available on the USART module. When this function returns true, these
7463  functions are supported on the device:
7464  - PLIB_USART_ReceiverEnable
7465  - PLIB_USART_ReceiverDisable
7466  This operation is atomic.
7467  Preconditions:
7468  None.
7469  Parameters:
7470  index - Identifier for the device instance
7471  Returns:
7472  - true - The ReceiverEnableControl feature is supported on the device
7473  - false - The ReceiverEnableControl feature is not supported on the device
7474  Remarks:
7475  None.
7476 */
7477 
7478 bool
7480  USART_MODULE_ID index ) ;
7481 //******************************************************************************
7482 /* Function:
7483  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7484  Summary:
7485  Identifies whether the ReceiverIdle feature exists on the USART module.
7486  Description:
7487  This function identifies whether the ReceiverIdle feature is
7488  available on the USART module. When this function returns true, this
7489  function is supported on the device:
7490  - PLIB_USART_ReceiverIsIdle
7491  This operation is atomic.
7492  Preconditions:
7493  None.
7494  Parameters:
7495  index - Identifier for the device instance
7496  Returns:
7497  - true - The ReceiverIdle feature is supported on the device
7498  - false - The ReceiverIdle feature is not supported on the device
7499  Remarks:
7500  None.
7501 */
7502 
7503 bool
7505  USART_MODULE_ID index ) ;
7506 //******************************************************************************
7507 /* Function:
7508  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7509  Summary:
7510  Identifies whether the ReceiverFramingError feature exists on the USART module.
7511  Description:
7512  This function identifies whether the ReceiverFramingError feature is
7513  available on the USART module. When this function returns true, this
7514  function is supported on the device:
7515  - PLIB_USART_ReceiverFramingErrorHasOccurred
7516  This operation is atomic.
7517  Preconditions:
7518  None.
7519  Parameters:
7520  index - Identifier for the device instance
7521  Returns:
7522  - true - The ReceiverFramingError feature is supported on the device
7523  - false - The ReceiverFramingError feature is not supported on the device
7524  Remarks:
7525  None.
7526 */
7527 
7528 bool
7530  USART_MODULE_ID index ) ;
7531 //******************************************************************************
7532 /* Function:
7533  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7534  Summary:
7535  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7536  Description:
7537  This function identifies whether the ReceiverInterruptMode feature is
7538  available on the USART module. When this function returns true, this
7539  function is supported on the device:
7540  - PLIB_USART_ReceiverInterruptModeSelect
7541  This operation is atomic.
7542  Preconditions:
7543  None.
7544  Parameters:
7545  index - Identifier for the device instance
7546  Returns:
7547  - true - The ReceiverInterruptMode feature is supported on the device
7548  - false - The ReceiverInterruptMode feature is not supported on the device
7549  Remarks:
7550  None.
7551 */
7552 
7553 bool
7555  USART_MODULE_ID index ) ;
7556 //******************************************************************************
7557 /* Function:
7558  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7559  Summary:
7560  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7561  Description:
7562  This function identifies whether the ReceiverPolarityInvert feature is
7563  available on the USART module. When this function returns true, these
7564  functions are supported on the device:
7565  - PLIB_USART_ReceiverIdleStateLowEnable
7566  - PLIB_USART_ReceiverIdleStateLowDisable
7567  This operation is atomic.
7568  Preconditions:
7569  None.
7570  Parameters:
7571  index - Identifier for the device instance
7572  Returns:
7573  - true - The ReceiverPolarityInvert feature is supported on the device
7574  - false - The ReceiverPolarityInvert feature is not supported on the device
7575  Remarks:
7576  None.
7577 */
7578 
7579 bool
7581  USART_MODULE_ID index ) ;
7582 //******************************************************************************
7583 /* Function:
7584  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7585  Summary:
7586  Identifies whether the ReceiverParityError feature exists on the USART module.
7587  Description:
7588  This function identifies whether the ReceiverParityError feature is
7589  available on the USART module. When this function returns true, this
7590  function is supported on the device:
7591  - PLIB_USART_ReceiverParityErrorHasOccurred
7592  This operation is atomic.
7593  Preconditions:
7594  None.
7595  Parameters:
7596  index - Identifier for the device instance
7597  Returns:
7598  - true - The ReceiverParityError feature is supported on the device
7599  - false - The ReceiverParityError feature is not supported on the device
7600  Remarks:
7601  None.
7602 */
7603 
7604 bool
7606  USART_MODULE_ID index ) ;
7607 //******************************************************************************
7608 /* Function:
7609  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7610  Summary:
7611  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7612  Description:
7613  This function identifies whether the ReceiverOverrunError feature is
7614  available on the USART module. When this function returns true, these
7615  functions are supported on the device:
7616  - PLIB_USART_ReceiverOverrunErrorClear
7617  - PLIB_USART_ReceiverOverrunHasOccurred
7618  This operation is atomic.
7619  Preconditions:
7620  None.
7621  Parameters:
7622  index - Identifier for the device instance
7623  Returns:
7624  - true - The ReceiverOverrunError feature is supported on the device
7625  - false - The ReceiverOverrunError feature is not supported on the device
7626  Remarks:
7627  None.
7628 */
7629 
7630 bool
7632  USART_MODULE_ID index ) ;
7633 //******************************************************************************
7634 /* Function:
7635  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7636  Summary:
7637  Identifies whether the Transmitter feature exists on the USART module.
7638  Description:
7639  This function identifies whether the Transmitter feature is
7640  available on the USART module. When this function returns true, these
7641  functions are supported on the device:
7642  - PLIB_USART_TransmitterByteSend
7643  - PLIB_USART_TransmitterAddressGet
7644  This operation is atomic.
7645  Preconditions:
7646  None.
7647  Parameters:
7648  index - Identifier for the device instance
7649  Returns:
7650  - true - The Transmitter feature is supported on the device
7651  - false - The Transmitter feature is not supported on the device
7652  Remarks:
7653  None.
7654 */
7655 
7656 bool
7658  USART_MODULE_ID index ) ;
7659 //******************************************************************************
7660 /* Function:
7661  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7662  Summary:
7663  Identifies whether the Transmitter9Bits feature exists on the USART module.
7664  Description:
7665  This function identifies whether the Transmitter9Bits feature is
7666  available on the USART module. When this function returns true, this
7667  function is supported on the device:
7668  - PLIB_USART_Transmitter9BitsSend
7669  This operation is atomic.
7670  Preconditions:
7671  None.
7672  Parameters:
7673  index - Identifier for the device instance
7674  Returns:
7675  - true - The Transmitter9Bits feature is supported on the device
7676  - false - The Transmitter9Bits feature is not supported on the device
7677  Remarks:
7678  None.
7679 */
7680 
7681 bool
7683  USART_MODULE_ID index ) ;
7684 //******************************************************************************
7685 /* Function:
7686  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7687  Summary:
7688  Identifies whether the TransmitterBreak feature exists on the USART module.
7689  Description:
7690  This function identifies whether the TransmitterBreak feature is
7691  available on the USART module. When this function returns true, these
7692  functions are supported on the device:
7693  - PLIB_USART_TransmitterBreakSend
7694  - PLIB_USART_TransmitterBreakSendIsComplete
7695  This operation is atomic.
7696  Preconditions:
7697  None.
7698  Parameters:
7699  index - Identifier for the device instance
7700  Returns:
7701  - true - The TransmitterBreak feature is supported on the device
7702  - false - The TransmitterBreak feature is not supported on the device
7703  Remarks:
7704  None.
7705 */
7706 
7707 bool
7709  USART_MODULE_ID index ) ;
7710 //******************************************************************************
7711 /* Function:
7712  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7713  Summary:
7714  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7715  Description:
7716  This function identifies whether the TransmitterBufferFull feature is
7717  available on the USART module. When this function returns true, this
7718  function is supported on the device:
7719  - PLIB_USART_TransmitterBufferIsFull
7720  This operation is atomic.
7721  Preconditions:
7722  None.
7723  Parameters:
7724  index - Identifier for the device instance
7725  Returns:
7726  - true - The TransmitterBufferFull feature is supported on the device
7727  - false - The TransmitterBufferFull feature is not supported on the device
7728  Remarks:
7729  None.
7730 */
7731 
7732 bool
7734  USART_MODULE_ID index ) ;
7735 //******************************************************************************
7736 /* Function:
7737  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7738  Summary:
7739  Identifies whether the TransmitterEmpty feature exists on the USART module.
7740  Description:
7741  This function identifies whether the TransmitterEmpty feature is
7742  available on the USART module. When this function returns true, this
7743  function is supported on the device:
7744  - PLIB_USART_TransmitterIsEmpty
7745  This operation is atomic.
7746  Preconditions:
7747  None.
7748  Parameters:
7749  index - Identifier for the device instance
7750  Returns:
7751  - true - The TransmitterEmpty feature is supported on the device
7752  - false - The TransmitterEmpty feature is not supported on the device
7753  Remarks:
7754  None.
7755 */
7756 
7757 bool
7759  USART_MODULE_ID index ) ;
7760 //******************************************************************************
7761 /* Function:
7762  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7763  Summary:
7764  Identifies whether the TransmitterEnableControl feature exists on the USART
7765  module
7766  Description:
7767  This function identifies whether the TransmitterEnableControl feature is
7768  available on the USART module. When this function returns true, these
7769  functions are supported on the device:
7770  - PLIB_USART_TransmitterEnable
7771  - PLIB_USART_TransmitterDisable
7772  This operation is atomic.
7773  Preconditions:
7774  None.
7775  Parameters:
7776  index - Identifier for the device instance
7777  Returns:
7778  - true - The TransmitterEnableControl feature is supported on the device
7779  - false - The TransmitterEnableControl feature is not supported on the device
7780  Remarks:
7781  None.
7782 */
7783 
7784 bool
7786  USART_MODULE_ID index ) ;
7787 //******************************************************************************
7788 /* Function:
7789  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7790  Summary:
7791  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7792  Description:
7793  This function identifies whether the TransmitterInterruptMode feature is
7794  available on the USART module. When this function returns true, this function
7795  is supported on the device:
7796  - PLIB_USART_TransmitterInterruptModeSelect
7797  This operation is atomic.
7798  Preconditions:
7799  None.
7800  Parameters:
7801  index - Identifier for the device instance
7802  Returns:
7803  - true - The TransmitterInterruptMode feature is supported on the device
7804  - false - The TransmitterInterruptMode feature is not supported on the device
7805  Remarks:
7806  None.
7807 */
7808 
7809 bool
7811  USART_MODULE_ID index ) ;
7812 //******************************************************************************
7813 /* Function:
7814  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7815  Summary:
7816  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7817  Description:
7818  This function identifies whether the TransmitterIdleIsLow feature is available
7819  on the USART module. When this function returns true, these functions are
7820  supported on the device:
7821  - PLIB_USART_TransmitterIdleIsLowDisable
7822  - PLIB_USART_TransmitterIdleIsLowEnable
7823  This operation is atomic.
7824  Preconditions:
7825  None.
7826  Parameters:
7827  index - Identifier for the device instance
7828  Returns:
7829  - true - The TransmitterIdleIsLow feature is supported on the device
7830  - false - The TransmitterIdleIsLow feature is not supported on the device
7831  Remarks:
7832  None.
7833 */
7834 
7835 bool
7837  USART_MODULE_ID index ) ;
7838 //DOM-IGNORE-BEGIN
7839 //DOM-IGNORE-END
7840  // #ifndef _PLIB_USART_H
7841 /******************************************************************************
7842  End of File
7843 */
7844 
7845 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7846 /* CLOSE_FILE Include File */
7847 
7848 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7849 /*******************************************************************************
7850  System Services Library Interface Header
7851  Company:
7852  Microchip Technology Inc.
7853  File Name:
7854  system.h
7855  Summary:
7856  Top level common system services library interface header.
7857  Description:
7858  This file is the top level common system services library interface header.
7859  It defines (or includes files that define) the common system service
7860  types, prototypes, and other definitions that are commonly used by MPLAB
7861  Harmony libraries and system services.
7862 
7863  System services provide common functionality that would otherwise need to
7864  be duplicated by multiple other modules or that would force them to
7865  interact in complex and hard to manage ways. System services eliminate
7866  conflicts by controlling access shared resources.
7867  Remarks:
7868  The parent directory to the "system" directory should be added to the
7869  compiler's search path for header files such that the following include
7870  statment will successfully include this file.
7871 
7872 #include "system/system.h"
7873  *******************************************************************************/
7874 //DOM-IGNORE-BEGIN
7875 /*******************************************************************************
7876 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7877 Microchip licenses to you the right to use, modify, copy and distribute
7878 Software only when embedded on a Microchip microcontroller or digital signal
7879 controller that is integrated into your product or third party product
7880 (pursuant to the sublicense terms in the accompanying license agreement).
7881 You should refer to the license agreement accompanying this Software for
7882 additional information regarding your rights and obligations.
7883 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7884 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7885 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7886 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7887 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7888 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7889 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7890 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7891 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7892 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7893  *******************************************************************************/
7894 //DOM-IGNORE-END
7895 #ifndef _SYSTEM_H
7896 #define _SYSTEM_H
7897 // *****************************************************************************
7898 // *****************************************************************************
7899 // Section: Included Files
7900 // *****************************************************************************
7901 // *****************************************************************************
7902 #include "system/common/sys_common.h"
7903 #include "system/common/sys_module.h"
7904 // DOM-IGNORE-BEGIN
7905 // DOM-IGNORE-END
7906 //DOM-IGNORE-BEGIN
7907 //DOM-IGNORE-END
7908  // _SYSTEM_H
7909 /*******************************************************************************
7910  End of File
7911 */
7912 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7913 /* CLOSE_FILE Include File */
7914 
7915 #include "system/int/sys_int.h"
7916 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7917 /*******************************************************************************
7918  DMA System Service Library Interface Definition
7919  Company:
7920  Microchip Technology Inc.
7921  File Name:
7922  sys_dma.h
7923  Summary:
7924  DMA System Service.
7925  Description:
7926  This file contains the interface definition for the DMA System
7927  Service. It provides a way to interact with the DMA subsystem to
7928  manage the data transfer between different peripherals and/or memory
7929  without intervention from the CPU.
7930 *******************************************************************************/
7931 //DOM-IGNORE-BEGIN
7932 /*******************************************************************************
7933 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7934 Microchip licenses to you the right to use, modify, copy and distribute
7935 Software only when embedded on a Microchip microcontroller or digital signal
7936 controller that is integrated into your product or third party product
7937 (pursuant to the sublicense terms in the accompanying license agreement).
7938 You should refer to the license agreement accompanying this Software for
7939 additional information regarding your rights and obligations.
7940 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7941 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7942 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7943 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7944 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7945 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7946 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7947 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7948 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7949 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7950 *******************************************************************************/
7951 //DOM-IGNORE-END
7952 #ifndef _SYS_DMA_H
7953 #define _SYS_DMA_H
7954 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7955 /*******************************************************************************
7956  DMA System Service Library Interface Definition
7957  Company:
7958  Microchip Technology Inc.
7959  File Name:
7960  sys_dma_definitions.h
7961  Summary:
7962  DMA System Service data type definitions header.
7963  Description:
7964  This file contains data type definitions header.
7965 *******************************************************************************/
7966 //DOM-IGNORE-BEGIN
7967 /*******************************************************************************
7968 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7969 Microchip licenses to you the right to use, modify, copy and distribute
7970 Software only when embedded on a Microchip microcontroller or digital signal
7971 controller that is integrated into your product or third party product
7972 (pursuant to the sublicense terms in the accompanying license agreement).
7973 You should refer to the license agreement accompanying this Software for
7974 additional information regarding your rights and obligations.
7975 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7976 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7977 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7978 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7979 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7980 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7981 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7982 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7983 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7984 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7985 *******************************************************************************/
7986 //DOM-IGNORE-END
7987 #ifndef _SYS_DMA_DEFINITIONS_H
7988 #define _SYS_DMA_DEFINITIONS_H
7989 // *****************************************************************************
7990 // *****************************************************************************
7991 // Section: File includes
7992 // *****************************************************************************
7993 // *****************************************************************************
7994 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7995 #include "system/common/sys_common.h"
7996 #include "system/common/sys_module.h"
7997 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7998 /*******************************************************************************
7999  DMA Peripheral Library Interface Header
8000  Company:
8001  Microchip Technology Inc.
8002  File Name:
8003  plib_dma.h
8004  Summary:
8005  Defines the DMA Peripheral Library interface functions.
8006  Description:
8007  This header file contains the function prototypes and definitions of
8008  the data types and constants that make up the interface to the Direct Memory
8009  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8010  definitions in this file are for the DMA module.
8011 *******************************************************************************/
8012 // DOM-IGNORE-BEGIN
8013 /*******************************************************************************
8014 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8015 Microchip licenses to you the right to use, modify, copy and distribute
8016 Software only when embedded on a Microchip microcontroller or digital signal
8017 controller that is integrated into your product or third party product
8018 (pursuant to the sublicense terms in the accompanying license agreement).
8019 You should refer to the license agreement accompanying this Software for
8020 additional information regarding your rights and obligations.
8021 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8022 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8023 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8024 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8025 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8026 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8027 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8028 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8029 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8030 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8031 *******************************************************************************/
8032 // DOM-IGNORE-END
8033 #ifndef _PLIB_DMA_H
8034 #define _PLIB_DMA_H
8035 // DOM-IGNORE-BEGIN
8036 // DOM-IGNORE-END
8037 // *****************************************************************************
8038 // *****************************************************************************
8039 // Section: Includes
8040 // *****************************************************************************
8041 // *****************************************************************************
8042 /* See Bottom of file for implementation header include files.
8043 */
8044 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8045 //DOM-IGNORE-BEGIN
8046 /*******************************************************************************
8047 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8048 Microchip licenses to you the right to use, modify, copy and distribute
8049 Software only when embedded on a Microchip microcontroller or digital signal
8050 controller that is integrated into your product or third party product
8051 (pursuant to the sublicense terms in the accompanying license agreement).
8052 You should refer to the license agreement accompanying this Software for
8053 additional information regarding your rights and obligations.
8054 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8055 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8056 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8057 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8058 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8059 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8060 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8061 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8062 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8063 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8064  *******************************************************************************/
8065 //DOM-IGNORE-END
8066 #ifndef _PLIB_DMA_PROCESSOR_H
8067 #define _PLIB_DMA_PROCESSOR_H
8068 #error "Can't find header"
8069 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8070 /* CLOSE_FILE Include File */
8071 
8072 // *****************************************************************************
8073 // *****************************************************************************
8074 // Section: Peripheral Library Interface Functions
8075 // *****************************************************************************
8076 // *****************************************************************************
8077 // *****************************************************************************
8078 // *****************************************************************************
8079 // Section: DMA Channel Status Functions
8080 // *****************************************************************************
8081 // *****************************************************************************
8082 //******************************************************************************
8083 /* Function:
8084  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8085  DMA_CHANNEL channel )
8086  Summary:
8087  Returns the buffered data write status for the specified channel.
8088  Description:
8089  This function returns the buffered data write status for the specified channel.
8090  Precondition:
8091  None.
8092  Parameters:
8093  channel - One of the existing DMA channels listed by DMA_CHANNEL
8094  Returns:
8095  - true - The content of the DMA buffer has not been written to the location
8096  specified in the destination/source address or in Null Write mode
8097  - false - The content of the DMA buffer has been written to the location
8098  specified in the destination/source address or in Null Write mode
8099  Example:
8100  <code>
8101  bool chBuffWriteStatus;
8102  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8103  DMA_CHANNEL_3 );
8104  </code>
8105  Remarks:
8106  This feature is not available on all devices. Please refer to the specific device
8107  data sheet to determine availability.
8108 */
8109 
8110 bool
8112  DMA_MODULE_ID index ,
8113  DMA_CHANNEL channel ) ;
8114 /*******************************************************************************
8115  Function:
8116  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8117  DMA_CHANNEL channel,
8118  DMA_CHANNEL_COLLISION collisonType )
8119  Summary:
8120  Returns the status of the specified collision type for the specified channel.
8121  Description:
8122  This function returns the status of the specified collision type for the
8123  specified channel.
8124  Precondition:
8125  None.
8126  Parameters:
8127  channel - One of the existing DMA channels listed by DMA_CHANNEL
8128  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8129  Returns:
8130  - true - A collision specified by collisonType was detected
8131  - false - No collision of type collisonType was detected
8132  Example:
8133  <code>
8134  bool memWriteCollisionStatus;
8135  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8136  DMA_ID_0,
8137  DMA_CHANNEL_3,
8138  DMA_CHANNEL_COLLISION_MEMORY );
8139  </code>
8140  Remarks:
8141  This feature is not available on all devices. Please refer to the specific
8142  device data sheet to determine availability.
8143 */
8144 
8145 bool
8147  DMA_MODULE_ID index ,
8148  DMA_CHANNEL channel ,
8149  DMA_CHANNEL_COLLISION collisonType ) ;
8150 //******************************************************************************
8151 /* Function:
8152  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8153  DMA_CHANNEL channel )
8154  Summary:
8155  Returns the Ping-Pong mode status for the specified channel.
8156  Description:
8157  This function returns the Ping-Pong mode status for the specified channel.
8158  Precondition:
8159  None.
8160  Parameters:
8161  channel - One of the existing DMA channels listed by DMA_CHANNEL
8162  Returns:
8163  mode - One of the possible Ping-Pong modes
8164  Example:
8165  <code>
8166  DMA_PING_PONG_MODE chPingPongStatus;
8167  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8168  DMA_CHANNEL_3 );
8169  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8170  {
8171  \\Application
8172  }
8173  </code>
8174  Remarks:
8175  This feature is not available on all devices. Please refer to the specific
8176  device data sheet to determine availability.
8177 */
8178 
8179 DMA_PING_PONG_MODE
8181  DMA_MODULE_ID index ,
8182  DMA_CHANNEL channel ) ;
8183 //******************************************************************************
8184 /* Function:
8185  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8186  DMA_CHANNEL channel )
8187  Summary:
8188  Returns the event status on the specified channel.
8189  Description:
8190  This function returns the event status on the specified channel.
8191  Precondition:
8192  None.
8193  Parameters:
8194  channel - One of the possible DMA channels listed by DMA_CHANNEL
8195  Returns:
8196  - true - An event was detected
8197  - false - No events were detected
8198  Example:
8199  <code>
8200  bool channeleventStatus;
8201  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8202  DMA_CHANNEL_2 );
8203  </code>
8204  Remarks:
8205  This function implements an operation of the ChannelXEvent feature.
8206  This feature may not be available on all devices. Please refer to the
8207  specific device data sheet to determine availability or include the
8208  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8209  whether this feature is available.
8210 */
8211 
8212 bool
8214  DMA_MODULE_ID index ,
8215  DMA_CHANNEL channel ) ;
8216 // *****************************************************************************
8217 // *****************************************************************************
8218 // Section: DMA Channel Configuration Functions
8219 // *****************************************************************************
8220 // *****************************************************************************
8221 //******************************************************************************
8222 /* Function:
8223  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8224  DMA_CHANNEL channel,
8225  DMA_CHANNEL_PRIORITY channelPriority )
8226  Summary:
8227  Sets the priority of the specified channel.
8228  Description:
8229  This function sets the priority of the specified channel.
8230  Precondition:
8231  None.
8232  Parameters:
8233  channel - One of the existing DMA channels listed by DMA_CHANNEL
8234  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8235  Returns:
8236  None.
8237  Example:
8238  <code>
8239  DMA_CHANNEL channel = DMA_CHANNEL_0;
8240  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8241  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8242  </code>
8243  Remarks:
8244  This function implements an operation of the ChannelXPriority feature.
8245  This feature may not be available on all devices. Please refer to the
8246  specific device data sheet to determine availability or use the
8247  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8248  whether this feature is available.
8249 */
8250 
8251 void
8253  DMA_MODULE_ID index ,
8254  DMA_CHANNEL channel ,
8255  DMA_CHANNEL_PRIORITY channelPriority ) ;
8256 //******************************************************************************
8257 /* Function:
8258  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8259  DMA_CHANNEL channel )
8260  Summary:
8261  Gets the priority of the specified channel.
8262  Description:
8263  This function gets the priority of the specified channel.
8264  Precondition:
8265  None.
8266  Parameters:
8267  channel - One of the existing DMA channels listed by DMA_CHANNEL
8268  Returns:
8269  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8270  Example:
8271  <code>
8272  DMA_CHANNEL channel = DMA_CHANNEL_0;
8273  DMA_CHANNEL_PRIORITY channelPriority;
8274  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8275  </code>
8276  Remarks:
8277  This function implements an operation of the ChannelXPriority feature.
8278  This feature may not be available on all devices. Please refer to the
8279  specific device data sheet to determine availability or use the
8280  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8281  whether this feature is available.
8282 */
8283 
8284 DMA_CHANNEL_PRIORITY
8286  DMA_MODULE_ID index ,
8287  DMA_CHANNEL channel ) ;
8288 //******************************************************************************
8289 /* Function:
8290  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8291  DMA_CHANNEL_PRIORITY channelPriority )
8292  Summary:
8293  Sets the priority scheme of the DMA channels.
8294  Description:
8295  This function sets the priority scheme of the DMA channels at the global level.
8296  This function is used in devices that do not have the per channel priority feature.
8297  Precondition:
8298  None.
8299  Parameters:
8300  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8301  Returns:
8302  None.
8303  Example:
8304  <code>
8305  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8306  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8307  </code>
8308  Remarks:
8309  This feature is not available on all devices. Please refer to the specific
8310  device data sheet to determine availability.
8311 */
8312 
8313 void
8315  DMA_MODULE_ID index ,
8316  DMA_CHANNEL_PRIORITY channelPriority ) ;
8317 //******************************************************************************
8318 /* Function:
8319  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8320  Summary:
8321  Gets the priority scheme of the DMA channels.
8322  Description:
8323  This function gets the priority scheme of the DMA channels at the global level.
8324  This function is used in devices that do not have the per channel priority feature.
8325  Precondition:
8326  None.
8327  Parameters:
8328  None.
8329  Returns:
8330  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8331  Example:
8332  <code>
8333  DMA_CHANNEL_PRIORITY channelPriority;
8334  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8335  </code>
8336  Remarks:
8337  This feature is not available on all devices. Please refer to the specific
8338  device data sheet to determine availability.
8339 */
8340 
8341 DMA_CHANNEL_PRIORITY
8343  DMA_MODULE_ID index ) ;
8344 //******************************************************************************
8345 /* Function:
8346  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8347  DMA_CHANNEL channel )
8348  Summary:
8349  Channel is continuously enabled.
8350  Description:
8351  This function enables the channel continuously. The channel is not automatically
8352  disabled after a block transfer is complete.
8353  Precondition:
8354  None.
8355  Parameters:
8356  channel - One of the possible DMA channels listed by DMA_CHANNEL
8357  Returns:
8358  None.
8359  Example:
8360  <code>
8361  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8362  </code>
8363  Remarks:
8364  This function implements an operation of the ChannelXAuto feature.
8365  This feature may not be available on all devices. Please refer to the
8366  specific device data sheet to determine availability or use the
8367  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8368  whether this feature is available.
8369 */
8370 
8371 void
8373  DMA_MODULE_ID index ,
8374  DMA_CHANNEL channel ) ;
8375 //******************************************************************************
8376 /* Function:
8377  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8378  DMA_CHANNEL channel )
8379  Summary:
8380  Returns the channel automatic enable status.
8381  Description:
8382  This function returns the channel automatic enable status.
8383  Precondition:
8384  None.
8385  Parameters:
8386  channel - One of the possible DMA channels listed by DMA_CHANNEL
8387  Returns:
8388  - true - Channel automatic enable is on
8389  - false - Channel automatic enable is off
8390  Example:
8391  <code>
8392  bool ChAutoEnableStatus;
8393  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8394  </code>
8395  Remarks:
8396  This function implements an operation of the ChannelXAuto feature.
8397  This feature may not be available on all devices. Please refer to the
8398  specific device data sheet to determine availability or use the
8399  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8400  whether this feature is available.
8401 */
8402 
8403 bool
8405  DMA_MODULE_ID index ,
8406  DMA_CHANNEL channel ) ;
8407 //******************************************************************************
8408 /* Function:
8409  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8410  DMA_CHANNEL channel )
8411  Summary:
8412  Channel is disabled after a block transfer is complete.
8413  Description:
8414  This function disables a channel after a block transfer is complete.
8415  Precondition:
8416  None.
8417  Parameters:
8418  channel - One of the possible DMA channels listed by DMA_CHANNEL
8419  Returns:
8420  None.
8421  Example:
8422  <code>
8423  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8424  </code>
8425  Remarks:
8426  This function implements an operation of the ChannelXAuto feature.
8427  This feature may not be available on all devices. Please refer to the
8428  specific device data sheet to determine availability or use the
8429  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8430  whether this feature is available.
8431 */
8432 
8433 void
8435  DMA_MODULE_ID index ,
8436  DMA_CHANNEL channel ) ;
8437 //******************************************************************************
8438 /* Function:
8439  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8440  DMA_CHANNEL channel )
8441  Summary:
8442  Channel chain feature is enabled.
8443  Description:
8444  This function enables the channel chain feature.
8445  Precondition:
8446  None.
8447  Parameters:
8448  channel - One of the possible DMA channels listed by DMA_CHANNEL
8449  Returns:
8450  None.
8451  Example:
8452  <code>
8453  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8454  </code>
8455  Remarks:
8456  This function implements an operation of the ChannelXChainEnbl feature.
8457  This feature may not be available on all devices. Please refer to the
8458  specific device data sheet to determine availability or use the
8459  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8460  whether this feature is available.
8461 */
8462 
8463 void
8465  DMA_MODULE_ID index ,
8466  DMA_CHANNEL channel ) ;
8467 //******************************************************************************
8468 /* Function:
8469  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8470  DMA_CHANNEL channel )
8471  Summary:
8472  Returns the chain status of the specified channel.
8473  Description:
8474  This function returns the chain status of the specified channel.
8475  Precondition:
8476  None.
8477  Parameters:
8478  channel - One of the possible DMA channels listed by DMA_CHANNEL
8479  Returns:
8480  - true - The channel chain is on for this channel
8481  - false - The channel chain is off for this channel
8482  Example:
8483  <code>
8484  bool ChchainStatus;
8485  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8486  </code>
8487  Remarks:
8488  This function implements an operation of the ChannelXChainEnbl feature.
8489  This feature may not be available on all devices. Please refer to the
8490  specific device data sheet to determine availability or use the
8491  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8492  whether this feature is available.
8493 */
8494 
8495 bool
8497  DMA_MODULE_ID index ,
8498  DMA_CHANNEL channel ) ;
8499 //******************************************************************************
8500 /* Function:
8501  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8502  DMA_CHANNEL channel )
8503  Summary:
8504  Disables the channel chaining for the specified DMA channel.
8505  Description:
8506  This function disables the channel chaining for the specified DMA channel.
8507  Precondition:
8508  None.
8509  Parameters:
8510  channel - One of the possible DMA channels listed by DMA_CHANNEL
8511  Returns:
8512  None.
8513  Example:
8514  <code>
8515  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8516  </code>
8517  Remarks:
8518  This function implements an operation of the ChannelXChainEnbl feature.
8519  This feature may not be available on all devices. Please refer to the
8520  specific device data sheet to determine availability or use the
8521  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8522  whether this feature is available.
8523 */
8524 
8525 void
8527  DMA_MODULE_ID index ,
8528  DMA_CHANNEL channel ) ;
8529 //******************************************************************************
8530 /* Function:
8531  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8532  DMA_CHANNEL channel )
8533  Summary:
8534  Channel start/abort events will be registered even if the channel is
8535  disabled.
8536  Description:
8537  This function will allow the channel register start/abort events even if the
8538  channel is disabled.
8539  Precondition:
8540  None.
8541  Parameters:
8542  channel - One of the possible DMA channels listed by DMA_CHANNEL
8543  Returns:
8544  None.
8545  Example:
8546  <code>
8547  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8548  </code>
8549  Remarks:
8550  This function implements an operation of the ChannelXDisabled feature.
8551  This feature may not be available on all devices. Please refer to the
8552  specific device data sheet to determine availability or use the
8553  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8554  determine whether this feature is available.
8555 */
8556 
8557 void
8559  DMA_MODULE_ID index ,
8560  DMA_CHANNEL channel ) ;
8561 //******************************************************************************
8562 /* Function:
8563  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8564  DMA_CHANNEL channel )
8565  Summary:
8566  Channel start/abort events will be ignored even if the channel is
8567  disabled.
8568  Description:
8569  This function will allow the channel start/abort events to be ignored even if
8570  the channel is disabled.
8571  Precondition:
8572  None.
8573  Parameters:
8574  channel - One of the possible DMA channels listed by DMA_CHANNEL
8575  Returns:
8576  None.
8577  Example:
8578  <code>
8579  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8580  </code>
8581  Remarks:
8582  This function implements an operation of the ChannelXDisabled feature.
8583  This feature may not be available on all devices. Please refer to the
8584  specific device data sheet to determine availability or use the
8585  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8586  determine whether this feature is available.
8587 */
8588 
8589 void
8591  DMA_MODULE_ID index ,
8592  DMA_CHANNEL channel ) ;
8593 //******************************************************************************
8594 /* Function:
8595  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8596  DMA_CHANNEL channel )
8597  Summary:
8598  Enable the specified channel.
8599  Description:
8600  This function will enable the specified channel.
8601  Precondition:
8602  None.
8603  Parameters:
8604  channel - One of the possible DMA channels listed by DMA_CHANNEL
8605  Returns:
8606  None.
8607  Example:
8608  <code>
8609  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8610  </code>
8611  Remarks:
8612  This function implements an operation of the ChannelX feature.
8613  This feature may not be available on all devices. Please refer to the
8614  specific device data sheet to determine availability or use the
8615  PLIB_DMA_ExistsChannelX function in your application to automatically
8616  determine whether this feature is available.
8617 */
8618 
8619 void
8621  DMA_MODULE_ID index ,
8622  DMA_CHANNEL channel ) ;
8623 //******************************************************************************
8624 /* Function:
8625  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8626  DMA_CHANNEL channel )
8627  Summary:
8628  Return the enable status of the specified channel.
8629  Description:
8630  This function will return the enable status of the specified channel.
8631  Precondition:
8632  None.
8633  Parameters:
8634  channel - One of the possible DMA channels listed by DMA_CHANNEL
8635  Returns:
8636  - true - The specified DMA channel is enabled
8637  - false - The specified DMA channel is disabled
8638  Example:
8639  <code>
8640  bool chEnableStatus;
8641  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8642  </code>
8643  Remarks:
8644  This function implements an operation of the ChannelX feature.
8645  This feature may not be available on all devices. Please refer to the
8646  specific device data sheet to determine availability or use the
8647  PLIB_DMA_ExistsChannelX function in your application to automatically
8648  determine whether this feature is available.
8649 */
8650 
8651 bool
8653  DMA_MODULE_ID index ,
8654  DMA_CHANNEL channel ) ;
8655 //******************************************************************************
8656 /* Function:
8657  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8658  DMA_CHANNEL channel )
8659  Summary:
8660  Disable the specified channel.
8661  Description:
8662  This function will disable the specified channel.
8663  Precondition:
8664  None.
8665  Parameters:
8666  channel - One of the possible DMA channels listed by DMA_CHANNEL
8667  Returns:
8668  None.
8669  Example:
8670  <code>
8671  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8672  </code>
8673  Remarks:
8674  This function implements an operation of the ChannelX feature.
8675  This feature may not be available on all devices. Please refer to the
8676  specific device data sheet to determine availability or use the
8677  PLIB_DMA_ExistsChannelX function in your application to automatically
8678  determine whether this feature is available.
8679 */
8680 
8681 void
8683  DMA_MODULE_ID index ,
8684  DMA_CHANNEL channel ) ;
8685 //******************************************************************************
8686 /* Function:
8687  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8688  DMA_CHANNEL channel )
8689  Summary:
8690  Chains the specified channel to a channel lower in natural priority.
8691  Description:
8692  This function will chain the specified channel to a channel lower in
8693  natural priority. CH3 will be enabled by a CH4 transfer complete.
8694  Precondition:
8695  None.
8696  Parameters:
8697  channel - One of the possible DMA channels listed by DMA_CHANNEL
8698  Returns:
8699  None.
8700  Example:
8701  <code>
8702  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8703  </code>
8704  Remarks:
8705  This function implements an operation of the ChannelXChain feature.
8706  This feature may not be available on all devices. Please refer to the
8707  specific device data sheet to determine availability or use the
8708  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8709  determine whether this feature is available.
8710 */
8711 
8712 void
8714  DMA_MODULE_ID index ,
8715  DMA_CHANNEL channel ) ;
8716 //******************************************************************************
8717 /* Function:
8718  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8719  DMA_CHANNEL channel )
8720  Summary:
8721  Chains the specified channel to a channel higher in natural priority.
8722  Description:
8723  This function will chain the specified channel to a channel higher in
8724  natural priority. CH5 will be enabled by a CH4 transfer complete.
8725  Precondition:
8726  None.
8727  Parameters:
8728  channel - One of the possible DMA channels listed by DMA_CHANNEL
8729  Returns:
8730  None.
8731  Example:
8732  <code>
8733  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8734  </code>
8735  Remarks:
8736  This function implements an operation of the ChannelXChain feature.
8737  This feature may not be available on all devices. Please refer to the
8738  specific device data sheet to determine availability or use the
8739  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8740  determine whether this feature is available.
8741 */
8742 
8743 void
8745  DMA_MODULE_ID index ,
8746  DMA_CHANNEL channel ) ;
8747 //******************************************************************************
8748 /* Function:
8749  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8750  DMA_CHANNEL channel )
8751  Summary:
8752  Sets the Busy bit to active.
8753  Description:
8754  This function sets the Busy bit to active, indicating the channel is active
8755  or has been enabled.
8756  Precondition:
8757  None.
8758  Parameters:
8759  channel - One of the possible DMA channels listed by DMA_CHANNEL
8760  Returns:
8761  None.
8762  Example:
8763  <code>
8764  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8765  </code>
8766  Remarks:
8767  This function implements an operation of the ChannelXBusy feature.
8768  This feature may not be available on all devices. Please refer to the
8769  specific device data sheet to determine availability or use the
8770  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8771  determine whether this feature is available.
8772 */
8773 
8774 void
8776  DMA_MODULE_ID index ,
8777  DMA_CHANNEL channel ) ;
8778 //******************************************************************************
8779 /* Function:
8780  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8781  DMA_CHANNEL channel )
8782  Summary:
8783  Sets the Busy bit to inactive.
8784  Description:
8785  This function sets the Busy bit to inactive, indicating the channel is inactive
8786  or has been disabled.
8787  Precondition:
8788  None.
8789  Parameters:
8790  channel - One of the possible DMA channels listed by DMA_CHANNEL
8791  Returns:
8792  None.
8793  Example:
8794  <code>
8795  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8796  </code>
8797  Remarks:
8798  This function implements an operation of the ChannelXBusy feature.
8799  This feature may not be available on all devices. Please refer to the
8800  specific device data sheet to determine availability or use the
8801  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8802  determine whether this feature is available.
8803 */
8804 
8805 void
8807  DMA_MODULE_ID index ,
8808  DMA_CHANNEL channel ) ;
8809 //******************************************************************************
8810 /* Function:
8811  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8812  DMA_CHANNEL channel )
8813  Summary:
8814  Returns the busy status of the specified channel.
8815  Description:
8816  This function returns the busy status of the specified channel.
8817  Precondition:
8818  None.
8819  Parameters:
8820  channel - One of the possible DMA channels listed by DMA_CHANNEL
8821  Returns:
8822  - true - The channel is active or has been enabled
8823  - false - The channel is inactive or has been disabled
8824  Example:
8825  <code>
8826  bool chBusyStatus;
8827  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8828  </code>
8829  Remarks:
8830  This function implements an operation of the ChannelXBusy feature.
8831  This feature may not be available on all devices. Please refer to the
8832  specific device data sheet to determine availability or use the
8833  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8834  determine whether this feature is available.
8835 */
8836 
8837 bool
8839  DMA_MODULE_ID index ,
8840  DMA_CHANNEL channel ) ;
8841 //******************************************************************************
8842 /* Function:
8843  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8844  DMA_CHANNEL channel,
8845  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8846  Summary:
8847  Selects the data transfer direction of the specified channel.
8848  Description:
8849  This function selects the data transfer direction of the specified channel.
8850  Precondition:
8851  None.
8852  Parameters:
8853  channel - One of the possible DMA channels listed by DMA_CHANNEL
8854  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8855  Returns:
8856  None.
8857  Example:
8858  <code>
8859  PLIB_DMA_ChannelXTransferDirectionSelect (
8860  DMA_ID_0,
8861  DMA_CHANNEL_4,
8862  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8863  </code>
8864  Remarks:
8865  This feature is not available on all devices. Please refer to the specific
8866  device data sheet to determine availability.
8867 */
8868 
8869 void
8871  DMA_MODULE_ID index ,
8872  DMA_CHANNEL channel ,
8873  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8874 //******************************************************************************
8875 /* Function:
8876  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8877  DMA_MODULE_ID index,
8878  DMA_CHANNEL channel)
8879  Summary:
8880  Returns the data transfer direction of the specified channel.
8881  Description:
8882  This function returns the data transfer direction of the specified channel.
8883  Precondition:
8884  None.
8885  Parameters:
8886  channel - One of the possible DMA channels listed by DMA_CHANNEL
8887  Returns:
8888  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8889  DMA_CHANNEL_TRANSFER_DIRECTION
8890  Example:
8891  <code>
8892  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8893  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8894  DMA_ID_0,
8895  DMA_CHANNEL_4 );
8896  </code>
8897  Remarks:
8898  This feature is not available on all devices. Please refer to the specific
8899  device data sheet to determine availability.
8900 */
8901 
8902 DMA_CHANNEL_TRANSFER_DIRECTION
8904  DMA_MODULE_ID index ,
8905  DMA_CHANNEL channel ) ;
8906 //******************************************************************************
8907 /* Function:
8908  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8909  DMA_CHANNEL channel ,
8910  uint16_t address,
8911  DMA_ADDRESS_OFFSET_TYPE offset )
8912  Summary:
8913  Sets the primary/secondary start address (DPSRAM) offset to the value
8914  specified depending on the offset type specified for the specified channel.
8915  Description:
8916  This function sets the primary/secondary start address (DPSRAM) offset to the value
8917  specified depending on the offset type specified for the specified channel.
8918  Precondition:
8919  None.
8920  Parameters:
8921  channel - One of the possible DMA channels listed by DMA_CHANNEL
8922  address - The primary/secondary DPSRAM start address offset
8923  offset - The type of the address offset (primary/secondary)
8924  Returns:
8925  None.
8926  Example:
8927  <code>
8928  uint16_t address = 0x100;
8929  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8930  DMA_CHANNEL_4,
8931  address,
8932  DMA_ADDRESS_OFFSET_PRIMARY );
8933  </code>
8934  Remarks:
8935  This feature is not available on all devices. Please refer to the specific
8936  device data sheet to determine availability.
8937 */
8938 
8939 void
8941  DMA_MODULE_ID index ,
8942  DMA_CHANNEL channel ,
8943  uint16_t address ,
8944  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8945 //******************************************************************************
8946 /* Function:
8947  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8948  DMA_CHANNEL channel,
8949  DMA_ADDRESS_OFFSET_TYPE offset)
8950  Summary:
8951  Gets the primary/secondary start address (DPSRAM) offset.
8952  Description:
8953  This function gets the primary/secondary start address (DPSRAM) offset.
8954  Precondition:
8955  None.
8956  Parameters:
8957  channel - One of the possible DMA channels listed by DMA_CHANNEL
8958  offset - The type of the address offset (primary/secondary)
8959  Returns:
8960  - uint16_t - The primary/secondary DPSRAM start address offset
8961  Example:
8962  <code>
8963  uint16_t addressOffsetA;
8964  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8965  DMA_ID_0,
8966  DMA_CHANNEL_4,
8967  address,
8968  DMA_ADDRESS_OFFSET_PRIMARY );
8969  </code>
8970  Remarks:
8971  This feature is not available on all devices. Please refer to the specific
8972  device data sheet to determine availability.
8973 */
8974 
8975 uint16_t
8977  DMA_MODULE_ID index ,
8978  DMA_CHANNEL channel ,
8979  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8980 //******************************************************************************
8981 /* Function:
8982  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8983  DMA_CHANNEL channel ,
8984  uint16_t peripheraladdress )
8985  Summary:
8986  Sets the peripheral address for the specified channel.
8987  Description:
8988  This function sets the peripheral address for the specified channel.
8989  Precondition:
8990  None.
8991  Parameters:
8992  channel - One of the possible DMA channels listed by DMA_CHANNEL
8993  peripheraladdress - The peripheral address for the specified channel
8994  Returns:
8995  None.
8996  Example:
8997  <code>
8998  uint16_t peripheraladdress = 0x100;
8999  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
9000  DMA_CHANNEL_4,
9001  peripheraladdress );
9002  </code>
9003  Remarks:
9004  This feature is not available on all devices. Please refer to the specific
9005  device data sheet to determine availability.
9006 */
9007 
9008 void
9010  DMA_MODULE_ID index ,
9011  DMA_CHANNEL channel ,
9012  uint16_t peripheraladdress ) ;
9013 //******************************************************************************
9014 /* Function:
9015  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9016  DMA_CHANNEL channel )
9017  Summary:
9018  Gets the peripheral address configured for the specified channel.
9019  Description:
9020  This function gets the peripheral address configured for the specified channel.
9021  Precondition:
9022  None.
9023  Parameters:
9024  channel - One of the possible DMA channels listed by DMA_CHANNEL
9025  Returns:
9026  - uint16_t - The peripheral address configured for the specified channel
9027  Example:
9028  <code>
9029  uint16_t peripheraladdress;
9030  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9031  DMA_CHANNEL_4 );
9032  </code>
9033  Remarks:
9034  This feature is not available on all devices. Please refer to the specific
9035  device data sheet to determine availability.
9036 */
9037 
9038 uint16_t
9040  DMA_MODULE_ID index ,
9041  DMA_CHANNEL channel ) ;
9042 //******************************************************************************
9043 /* Function:
9044  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9045  DMA_CHANNEL channel ,
9046  uint16_t transferCount )
9047  Summary:
9048  Sets the DMA data transfer count for the specified channel.
9049  Description:
9050  This function sets the DMA data transfer count for the specified channel.
9051  Precondition:
9052  None.
9053  Parameters:
9054  channel - One of the possible DMA channels listed by DMA_CHANNEL
9055  transferCount - The DMA transfer count for the channel
9056  Returns:
9057  None.
9058  Example:
9059  <code>
9060  uint16_t transferCount = 0x10;
9061  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9062  DMA_CHANNEL_4,
9063  transferCount );
9064  </code>
9065  Remarks:
9066  This feature is not available on all devices. Please refer to the specific
9067  device data sheet to determine availability.
9068 */
9069 
9070 void
9072  DMA_MODULE_ID index ,
9073  DMA_CHANNEL channel ,
9074  uint16_t transferCount ) ;
9075 //******************************************************************************
9076 /* Function:
9077  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9078  DMA_CHANNEL channel )
9079  Summary:
9080  Gets the DMA data transfer count that is programmed for the specified channel.
9081  Description:
9082  This function gets the DMA data transfer count that is programmed for the specified channel.
9083  Precondition:
9084  None.
9085  Parameters:
9086  channel - One of the possible DMA channels listed by DMA_CHANNEL
9087  Returns:
9088  - uint16_t - The DMA transfer count for the channel
9089  Example:
9090  <code>
9091  uint16_t transferCount;
9092  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9093  DMA_CHANNEL_4 );
9094  </code>
9095  Remarks:
9096  This feature is not available on all devices. Please refer to the specific
9097  device data sheet to determine availability.
9098 */
9099 
9100 uint16_t
9102  DMA_MODULE_ID index ,
9103  DMA_CHANNEL channel ) ;
9104 //******************************************************************************
9105 /* Function:
9106  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9107  DMA_MODULE_ID index,
9108  DMA_CHANNEL channel,
9109  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9110  Summary:
9111  Sets the source address mode of the specified channel.
9112  Description:
9113  This function sets the source address mode of the specified channel.
9114  Precondition:
9115  None.
9116  Parameters:
9117  channel - One of the possible DMA channels listed by DMA_CHANNEL
9118  sourceAddressMode - One of the possible source addressing modes listed by
9119  DMA_SOURCE_ADDRESSING_MODE
9120  Returns:
9121  None.
9122  Example:
9123  <code>
9124  PLIB_DMA_ChannelXSourceAddressModeSelect (
9125  DMA_ID_0,
9126  DMA_CHANNEL_4,
9127  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9128  </code>
9129  Remarks:
9130  This feature is not available on all devices. Please refer to the specific
9131  device data sheet to determine availability.
9132 */
9133 
9134 void
9136  DMA_MODULE_ID index ,
9137  DMA_CHANNEL channel ,
9138  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9139 //******************************************************************************
9140 /* Function:
9141  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9142  DMA_MODULE_ID index,
9143  DMA_CHANNEL channel )
9144  Summary:
9145  Gets the source address mode of the specified channel.
9146  Description:
9147  This function gets the source address mode of the specified channel.
9148  Precondition:
9149  None.
9150  Parameters:
9151  channel - One of the possible DMA channels listed by DMA_CHANNEL
9152  Returns:
9153  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9154  listed by DMA_SOURCE_ADDRESSING_MODE
9155  Example:
9156  <code>
9157  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9158  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9159  DMA_CHANNEL_4 );
9160  </code>
9161  Remarks:
9162  This feature is not available on all devices. Please refer to the specific
9163  device data sheet to determine availability.
9164 */
9165 
9166 DMA_SOURCE_ADDRESSING_MODE
9168  DMA_MODULE_ID index ,
9169  DMA_CHANNEL channel ) ;
9170 //******************************************************************************
9171 /* Function:
9172  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9173  DMA_MODULE_ID index,
9174  DMA_CHANNEL channel,
9175  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9176  Summary:
9177  Sets the source address mode of the specified channel.
9178  Description:
9179  This function Sets the source address mode of the specified channel.
9180  Precondition:
9181  None.
9182  Parameters:
9183  channel - One of the possible DMA channels listed by DMA_CHANNEL
9184  destinationAddressMode - One of the possible source addressing modes listed by
9185  DMA_DESTINATION_ADDRESSING_MODE
9186  Returns:
9187  None.
9188  Example:
9189  <code>
9190  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9191  DMA_ID_0,
9192  DMA_CHANNEL_4,
9193  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9194  </code>
9195  Remarks:
9196  This feature is not available on all devices. Please refer to the specific
9197  device data sheet to determine availability.
9198 */
9199 
9200 void
9202  DMA_MODULE_ID index ,
9203  DMA_CHANNEL channel ,
9204  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9205 //******************************************************************************
9206 /* Function:
9207  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9208  DMA_MODULE_ID index,
9209  DMA_CHANNEL channel )
9210  Summary:
9211  Gets the source address mode of the specified channel.
9212  Description:
9213  This function gets the source address mode of the specified channel.
9214  Precondition:
9215  None.
9216  Parameters:
9217  channel - One of the possible DMA channels listed by DMA_CHANNEL
9218  Returns:
9219  - destinationAddressMode - One of the possible source addressing modes listed by
9220  DMA_DESTINATION_ADDRESSING_MODE
9221  Example:
9222  <code>
9223  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9224  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9225  DMA_ID_0,
9226  DMA_CHANNEL_4 );
9227  </code>
9228  Remarks:
9229  This feature is not available on all devices. Please refer to the specific
9230  device data sheet to determine availability.
9231 */
9232 
9233 DMA_DESTINATION_ADDRESSING_MODE
9235  DMA_MODULE_ID index ,
9236  DMA_CHANNEL channel ) ;
9237 //******************************************************************************
9238 /* Function:
9239  void PLIB_DMA_ChannelXAddressModeSelect (
9240  DMA_MODULE_ID index,
9241  DMA_CHANNEL channel,
9242  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9243  Summary:
9244  Sets the channel address mode.
9245  Description:
9246  This function sets the channel address mode.
9247  Precondition:
9248  None.
9249  Parameters:
9250  channel - One of the possible DMA channels listed by DMA_CHANNEL
9251  channelAddressMode - One of the possible channel addressing modes listed by
9252  DMA_CHANNEL_ADDRESSING_MODE
9253  Returns:
9254  None.
9255  Example:
9256  <code>
9257  PLIB_DMA_ChannelXAddressModeSelect (
9258  DMA_ID_0,
9259  DMA_CHANNEL_4,
9260  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9261  </code>
9262  Remarks:
9263  This feature is not available on all devices. Please refer to the specific
9264  device data sheet to determine availability.
9265 */
9266 
9267 void
9269  DMA_MODULE_ID index ,
9270  DMA_CHANNEL channel ,
9271  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9272 //******************************************************************************
9273 /* Function:
9274  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9275  DMA_MODULE_ID index,
9276  DMA_CHANNEL channel )
9277  Summary:
9278  Gets the channel address mode.
9279  Description:
9280  This function gets the channel address mode.
9281  Precondition:
9282  None.
9283  Parameters:
9284  channel - One of the possible DMA channels listed by DMA_CHANNEL
9285  Returns:
9286  - channelAddressMode - One of the possible source addressing modes listed by
9287  DMA_CHANNEL_ADDRESSING_MODE
9288  Example:
9289  <code>
9290  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9291  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9292  DMA_CHANNEL_4 );
9293  </code>
9294  Remarks:
9295  This feature is not available on all devices. Please refer to the specific
9296  device data sheet to determine availability.
9297 */
9298 
9299 DMA_CHANNEL_ADDRESSING_MODE
9301  DMA_MODULE_ID index ,
9302  DMA_CHANNEL channel ) ;
9303 // *****************************************************************************
9304 // *****************************************************************************
9305 // Section: DMA Channel Event Configuration functions
9306 // *****************************************************************************
9307 // *****************************************************************************
9308 //******************************************************************************
9309 /* Function:
9310  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9311  DMA_CHANNEL channel,
9312  DMA_CHANNEL_TRIGGER_TYPE trigger )
9313  Summary:
9314  Enables the specified DMA channel trigger.
9315  Description:
9316  This function enables the specified DMA channel trigger.
9317  Precondition:
9318  None.
9319  Parameters:
9320  channel - One of the possible DMA channels listed by DMA_CHANNEL
9321  trigger - Type of trigger (transfer start/abort/pattern match abort)
9322  Returns:
9323  None.
9324  Example:
9325  <code>
9326  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9327  DMA_CHANNEL_4,
9328  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9329  </code>
9330  Remarks:
9331  This function implements an operation of the ChannelXTrigger feature.
9332  This feature may not be available on all devices. Please refer to the
9333  specific device data sheet to determine availability or use the
9334  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9335  determine whether this feature is available.
9336 */
9337 
9338 void
9340  DMA_MODULE_ID index ,
9341  DMA_CHANNEL channel ,
9342  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9343 //******************************************************************************
9344 /* Function:
9345  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9346  DMA_CHANNEL channel,
9347  DMA_CHANNEL_TRIGGER_TYPE trigger )
9348  Summary:
9349  Returns the enable status of the specified DMA transfer/abort trigger.
9350  Description:
9351  This function returns the enable status of the specified DMA transfer/abort trigger.
9352  Precondition:
9353  None.
9354  Parameters:
9355  channel - One of the possible DMA channels listed by DMA_CHANNEL
9356  trigger - Type of trigger (transfer start/abort/pattern match abort)
9357  Returns:
9358  - true - The specified trigger is enabled
9359  - false - The specified trigger is disabled
9360  Example:
9361  <code>
9362  bool startTriggerstatus;
9363  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9364  DMA_ID_0,
9365  DMA_CHANNEL_4,
9366  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9367  </code>
9368  Remarks:
9369  This function implements an operation of the ChannelXTrigger feature.
9370  This feature may not be available on all devices. Please refer to the
9371  specific device data sheet to determine availability or use the
9372  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9373  determine whether this feature is available.
9374 */
9375 
9376 bool
9378  DMA_MODULE_ID index ,
9379  DMA_CHANNEL channel ,
9380  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9381 //******************************************************************************
9382 /* Function:
9383  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9384  DMA_CHANNEL channel,
9385  DMA_CHANNEL_TRIGGER_TYPE trigger )
9386  Summary:
9387  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9388  Description:
9389  This function disables the DMA transfer abort via a matching interrupt
9390  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9391  a transfer.
9392  Precondition:
9393  None.
9394  Parameters:
9395  channel - One of the possible DMA channels listed by DMA_CHANNEL
9396  trigger - Type of trigger (transfer start/abort/pattern match abort)
9397  Returns:
9398  None.
9399  Example:
9400  <code>
9401  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9402  DMA_CHANNEL_4,
9403  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9404  </code>
9405  Remarks:
9406  This function implements an operation of the ChannelXTrigger feature.
9407  This feature may not be available on all devices. Please refer to the
9408  specific device data sheet to determine availability or use the
9409  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9410  determine whether this feature is available.
9411 */
9412 
9413 void
9415  DMA_MODULE_ID index ,
9416  DMA_CHANNEL channel ,
9417  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9418 //******************************************************************************
9419 /* Function:
9420  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9421  DMA_CHANNEL channel)
9422  Summary:
9423  Gets the source number for the DMA channel interrupts.
9424  Description:
9425  This function returns the interrupt source number for the specified
9426  DMA channel.
9427  Precondition:
9428  None.
9429  Parameters:
9430  channel - One of the possible DMA channels listed by DMA_CHANNEL
9431  Returns:
9432  None.
9433  Example:
9434  <code>
9435  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9436  DMA_CHANNEL_4);
9437  </code>
9438  Remarks:
9439  This function implements an operation of the ChannelXTrigger feature.
9440  This feature may not be available on all devices. Please refer to the
9441  specific device data sheet to determine availability or use the
9442  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9443  determine whether this feature is available.
9444 */
9445 
9446 DMA_CHANNEL_INT_SOURCE
9448  DMA_MODULE_ID index ,
9449  DMA_CHANNEL channel ) ;
9450 //******************************************************************************
9451 /* Function:
9452  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9453  DMA_CHANNEL channel,
9454  DMA_TRIGGER_SOURCE IRQnum )
9455  Summary:
9456  Sets the IRQ to initiate the DMA transfer on the specified channel.
9457  Description:
9458  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9459  (IRQ to start the channel transfer.)
9460  Precondition:
9461  None.
9462  Parameters:
9463  channel - One of the possible DMA channels listed by DMA_CHANNEL
9464  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9465  Returns:
9466  None.
9467  Example:
9468  <code>
9469  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9470  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9471  DMA_CHANNEL_4,
9472  irq );
9473  </code>
9474  Remarks:
9475  This function implements an operation of the ChannelXStartIRQ feature.
9476  This feature may not be available on all devices. Please refer to the
9477  specific device data sheet to determine availability or use the
9478  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9479  determine whether this feature is available.
9480 */
9481 
9482 void
9484  DMA_MODULE_ID index ,
9485  DMA_CHANNEL channel ,
9486  DMA_TRIGGER_SOURCE IRQnum ) ;
9487 //******************************************************************************
9488 /* Function:
9489  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9490  DMA_CHANNEL channel,
9491  DMA_TRIGGER_SOURCE IRQ )
9492  Summary:
9493  Sets the IRQ to abort the DMA transfer on the specified channel.
9494  Description:
9495  This function sets the IRQ to abort the DMA transfer on the specified channel.
9496  (IRQ to start the channel transfer.)
9497  Precondition:
9498  None.
9499  Parameters:
9500  channel - One of the possible DMA channels listed by DMA_CHANNEL
9501  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9502  Returns:
9503  None.
9504  Example:
9505  <code>
9506  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9507  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9508  DMA_CHANNEL_4,
9509  irq );
9510  </code>
9511  Remarks:
9512  This function implements an operation of the ChannelXAbortIRQ feature.
9513  This feature may not be available on all devices. Please refer to the
9514  specific device data sheet to determine availability or use the
9515  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9516  determine whether this feature is available.
9517 */
9518 
9519 void
9521  DMA_MODULE_ID index ,
9522  DMA_CHANNEL channel ,
9523  DMA_TRIGGER_SOURCE IRQ ) ;
9524 //******************************************************************************
9525 /* Function:
9526  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9527  DMA_CHANNEL channel,
9528  DMA_CHANNEL_DATA_SIZE channelDataSize )
9529  Summary:
9530  Selects the data size for the specified channel.
9531  Description:
9532  This function selects the data size for the specified channel.
9533  Precondition:
9534  None.
9535  Parameters:
9536  channel - One of the possible DMA channels listed by DMA_CHANNEL
9537  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9538  Returns:
9539  None.
9540  Example:
9541  <code>
9542  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9543  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9544  DMA_CHANNEL_4,
9545  channelDataSize );
9546  </code>
9547  Remarks:
9548  This feature is not available on all devices. Please refer to the specific
9549  device data sheet to determine availability.
9550 */
9551 
9552 void
9554  DMA_MODULE_ID index ,
9555  DMA_CHANNEL channel ,
9556  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9557 //******************************************************************************
9558 /* Function:
9559  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9560  DMA_CHANNEL channel )
9561  Summary:
9562  Returns the current data size for the specified channel.
9563  Description:
9564  This function returns the current data size for the specified channel.
9565  Precondition:
9566  None.
9567  Parameters:
9568  channel - One of the possible DMA channels listed by DMA_CHANNEL
9569  Returns:
9570  - channelDataSize - One of the possible data sizes listed by
9571  DMA_CHANNEL_DATA_SIZE
9572  Example:
9573  <code>
9574  DMA_CHANNEL_DATA_SIZE channelDataSize;
9575  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9576  DMA_CHANNEL_4 );
9577  </code>
9578  Remarks:
9579  This feature is not available on all devices. Please refer to the specific
9580  device data sheet to determine availability.
9581 */
9582 
9583 DMA_CHANNEL_DATA_SIZE
9585  DMA_MODULE_ID index ,
9586  DMA_CHANNEL channel ) ;
9587 //******************************************************************************
9588 /* Function:
9589  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9590  DMA_MODULE_ID index,
9591  DMA_CHANNEL channel,
9592  DMA_TRANSFER_MODE channeltransferMode )
9593  Summary:
9594  Selects the transfer/operating mode for the specified channel.
9595  Description:
9596  This function selects the transfer/operating mode for the specified channel.
9597  (Transfer mode and operating mode are used interchangeably.)
9598  Precondition:
9599  None.
9600  Parameters:
9601  channel - One of the possible DMA channels listed by DMA_CHANNEL
9602  channeltransferMode - One of the possible operating/transfer modes listed by
9603  DMA_TRANSFER_MODE
9604  Returns:
9605  None.
9606  Example:
9607  <code>
9608  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9609  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9610  DMA_CHANNEL_4,
9611  channeltransferMode );
9612  </code>
9613  Remarks:
9614  This feature is not available on all devices. Please refer to the specific
9615  device data sheet to determine availability.
9616 */
9617 
9618 void
9620  DMA_MODULE_ID index ,
9621  DMA_CHANNEL channel ,
9622  DMA_TRANSFER_MODE channeltransferMode ) ;
9623 //******************************************************************************
9624 /* Function:
9625  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9626  DMA_MODULE_ID index,
9627  DMA_CHANNEL channel )
9628  Summary:
9629  Returns the current transfer/operating mode for the specified channel.
9630  Description:
9631  This function returns the current transfer/operating mode for the specified channel.
9632  (Transfer mode and operating mode are used interchangeably.)
9633  Precondition:
9634  None.
9635  Parameters:
9636  channel - One of the possible DMA channels listed by DMA_CHANNEL
9637  Returns:
9638  - channeltransferMode - One of the possible operating/transfer modes listed
9639  by DMA_TRANSFER_MODE
9640  Example:
9641  <code>
9642  DMA_TRANSFER_MODE channeltransferMode;
9643  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9644  DMA_ID_0,
9645  DMA_CHANNEL_4 );
9646  </code>
9647  Remarks:
9648  This feature is not available on all devices. Please refer to the specific
9649  device data sheet to determine availability.
9650 */
9651 
9652 DMA_TRANSFER_MODE
9654  DMA_MODULE_ID index ,
9655  DMA_CHANNEL channel ) ;
9656 //******************************************************************************
9657 /* Function:
9658  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9659  DMA_CHANNEL channel )
9660  Summary:
9661  Enables reloading of the address and count registers.
9662  Description:
9663  This function enables reloading of the address and count registers. The source,
9664  destination address, and the DMA count registers are reloaded to their previous
9665  values upon the start of the next operation.
9666  Precondition:
9667  None.
9668  Parameters:
9669  channel - One of the possible DMA channels listed by DMA_CHANNEL
9670  Returns:
9671  None.
9672  Example:
9673  <code>
9674  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9675  DMA_CHANNEL_4 );
9676  </code>
9677  Remarks:
9678  This feature is not available on all devices. Please refer to the specific
9679  device data sheet to determine availability.
9680 */
9681 
9682 void
9684  DMA_MODULE_ID index ,
9685  DMA_CHANNEL channel ) ;
9686 //******************************************************************************
9687 /* Function:
9688  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9689  DMA_CHANNEL channel )
9690  Summary:
9691  Returns the address and count registers reload enable status.
9692  Description:
9693  This function returns the address and count registers reload enable status.
9694  Precondition:
9695  None.
9696  Parameters:
9697  channel - One of the possible DMA channels listed by DMA_CHANNEL
9698  Returns:
9699  - true - The address and count registers reload is enabled
9700  - false - The address and count registers reload is disabled
9701  Example:
9702  <code>
9703  bool chAddressCountReloadStatus;
9704  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9705  DMA_ID_0,
9706  DMA_CHANNEL_4 );
9707  </code>
9708  Remarks:
9709  This feature is not available on all devices. Please refer to the specific
9710  device data sheet to determine availability.
9711 */
9712 
9713 bool
9715  DMA_MODULE_ID index ,
9716  DMA_CHANNEL channel ) ;
9717 //******************************************************************************
9718 /* Function:
9719  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9720  DMA_CHANNEL channel )
9721  Summary:
9722  Disables reloading of the address and count registers.
9723  Description:
9724  This function disables reloading of the address and count registers. The source, destination
9725  address, and the DMA count registers are not reloaded to their previous values upon
9726  the start of the next operation.
9727  Precondition:
9728  None.
9729  Parameters:
9730  channel - One of the possible DMA channels listed by DMA_CHANNEL
9731  Returns:
9732  None.
9733  Example:
9734  <code>
9735  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9736  DMA_CHANNEL_4 );
9737  </code>
9738  Remarks:
9739  This feature is not available on all devices. Please refer to the specific
9740  device data sheet to determine availability.
9741 */
9742 
9743 void
9745  DMA_MODULE_ID index ,
9746  DMA_CHANNEL channel ) ;
9747 //******************************************************************************
9748 /* Function:
9749  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9750  DMA_CHANNEL channel )
9751  Summary:
9752  Enables the Null Write mode.
9753  Description:
9754  This function enables the Null Write mode. A dummy write is initiated to the
9755  source address for every write to the destination address.
9756  Precondition:
9757  None.
9758  Parameters:
9759  channel - One of the possible DMA channels listed by DMA_CHANNEL
9760  Returns:
9761  None.
9762  Example:
9763  <code>
9764  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9765  DMA_CHANNEL_4 );
9766  </code>
9767  Remarks:
9768  This feature is not available on all devices. Please refer to the specific
9769  device data sheet to determine availability.
9770 */
9771 
9772 void
9774  DMA_MODULE_ID index ,
9775  DMA_CHANNEL channel ) ;
9776 //******************************************************************************
9777 /* Function:
9778  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9779  DMA_CHANNEL channel )
9780  Summary:
9781  Returns the enable status of the Null Write mode for the specified channel.
9782  Description:
9783  This function returns the enable status of the Null Write mode for the specified channel.
9784  Precondition:
9785  None.
9786  Parameters:
9787  channel - One of the possible DMA channels listed by DMA_CHANNEL
9788  Returns:
9789  - true - Null write mode is enabled for this channel
9790  - false - Null write mode is disabled for this channel
9791  Example:
9792  <code>
9793  bool chNullWriteStatus;
9794  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9795  DMA_ID_0,
9796  DMA_CHANNEL_4 );
9797  </code>
9798  Remarks:
9799  This feature is not available on all devices. Please refer to the specific
9800  device data sheet to determine availability.
9801 */
9802 
9803 bool
9805  DMA_MODULE_ID index ,
9806  DMA_CHANNEL channel ) ;
9807 //******************************************************************************
9808 /* Function:
9809  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9810  DMA_CHANNEL channel )
9811  Summary:
9812  Disables the Null Write mode.
9813  Description:
9814  This function disables the Null Write mode. No dummy write is initiated.
9815  Precondition:
9816  None.
9817  Parameters:
9818  channel - One of the possible DMA channels listed by DMA_CHANNEL
9819  Returns:
9820  None.
9821  Example:
9822  <code>
9823  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9824  DMA_CHANNEL_4 );
9825  </code>
9826  Remarks:
9827  This feature is not available on all devices. Please refer to the specific
9828  device data sheet to determine availability.
9829 */
9830 
9831 void
9833  DMA_MODULE_ID index ,
9834  DMA_CHANNEL channel ) ;
9835 // *****************************************************************************
9836 // *****************************************************************************
9837 // Section: DMA start/end functions
9838 // *****************************************************************************
9839 // *****************************************************************************
9840 //******************************************************************************
9841 /* Function:
9842  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9843  DMA_CHANNEL channel )
9844  Summary:
9845  Initiates transfer on the specified channel.
9846  Description:
9847  This function initiates transfer on the specified channel. This is a forced transfer
9848  controlled via software.
9849  Precondition:
9850  None.
9851  Parameters:
9852  channel - One of the possible DMA channels listed by DMA_CHANNEL
9853  Returns:
9854  None.
9855  Example:
9856  <code>
9857  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9858  DMA_CHANNEL_4 );
9859  </code>
9860  Remarks:
9861  This function implements an operation of the StartTransfer feature.
9862  This feature may not be available on all devices. Please refer to the
9863  specific device data sheet to determine availability or use the
9864  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9865  determine whether this feature is available.
9866 */
9867 
9868 void
9870  DMA_MODULE_ID index ,
9871  DMA_CHANNEL channel ) ;
9872 //******************************************************************************
9873 /* Function:
9874  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9875  DMA_CHANNEL channel )
9876  Summary:
9877  Aborts transfer on the specified channel.
9878  Description:
9879  This function aborts transfer on the specified channel. This is a forced abort
9880  controlled via software.
9881  Precondition:
9882  None.
9883  Parameters:
9884  channel - One of the possible DMA channels listed by DMA_CHANNEL
9885  Returns:
9886  None.
9887  Example:
9888  <code>
9889  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9890  DMA_CHANNEL_4 );
9891  </code>
9892  Remarks:
9893  This function implements an operation of the AbortTransfer feature.
9894  This feature may not be available on all devices. Please refer to the
9895  specific device data sheet to determine availability or use the
9896  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9897  determine whether this feature is available.
9898 */
9899 
9900 void
9902  DMA_MODULE_ID index ,
9903  DMA_CHANNEL channel ) ;
9904 // *****************************************************************************
9905 // *****************************************************************************
9906 // Section: DMA General Configuration functions
9907 // *****************************************************************************
9908 // *****************************************************************************
9909 //******************************************************************************
9910 /* Function:
9911  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9912  Summary:
9913  Sets the BUSY bit of the DMA controller.
9914  Description:
9915  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9916  Precondition:
9917  None.
9918  Parameters:
9919  None.
9920  Returns:
9921  None.
9922  Example:
9923  <code>
9924  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9925  </code>
9926  Remarks:
9927  This function implements an operation of the Busy feature.
9928  This feature may not be available on all devices. Please refer to the
9929  specific device data sheet to determine availability or use the
9930  PLIB_DMA_ExistsBusy function in your application to automatically
9931  determine whether this feature is available.
9932 */
9933 
9934 void
9936  DMA_MODULE_ID index ) ;
9937 //******************************************************************************
9938 /* Function:
9939  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9940  Summary:
9941  Resets the BUSY bit of the DMA controller.
9942  Description:
9943  This function resets the BUSY bit of the DMA controller. The DMA module is
9944  disabled and is not actively transferring data.
9945  Precondition:
9946  None.
9947  Parameters:
9948  None.
9949  Returns:
9950  None.
9951  Example:
9952  <code>
9953  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9954  </code>
9955  Remarks:
9956  This function implements an operation of the Busy feature.
9957  This feature may not be available on all devices. Please refer to the
9958  specific device data sheet to determine availability or use the
9959  PLIB_DMA_ExistsBusy function in your application to automatically
9960  determine whether this feature is available.
9961 */
9962 
9963 void
9965  DMA_MODULE_ID index ) ;
9966 //******************************************************************************
9967 /* Function:
9968  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9969  Summary:
9970  Gets the BUSY bit of the DMA controller.
9971  Description:
9972  This function gets the BUSY bit of the DMA controller.
9973  Precondition:
9974  None.
9975  Parameters:
9976  None.
9977  Returns:
9978  - true - DMA module is active
9979  - false - DMA module is disabled and is not actively transferring data
9980  Example:
9981  <code>
9982  bool dmaBusyStatus;
9983  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9984  </code>
9985  Remarks:
9986  This function implements an operation of the Busy feature.
9987  This feature may not be available on all devices. Please refer to the
9988  specific device data sheet to determine availability or use the
9989  PLIB_DMA_ExistsBusy function in your application to automatically
9990  determine whether this feature is available.
9991 */
9992 
9993 bool
9994  PLIB_DMA_IsBusy (
9995  DMA_MODULE_ID index ) ;
9996 //******************************************************************************
9997 /* Function:
9998  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9999  Summary:
10000  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
10001  Description:
10002  This function suspends the DMA transfers to allow uninterrupted access
10003  by the CPU to the data bus.
10004  Precondition:
10005  None.
10006  Parameters:
10007  None.
10008  Returns:
10009  None.
10010  Example:
10011  <code>
10012  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10013  </code>
10014  Remarks:
10015  This function implements an operation of the Suspend feature.
10016  This feature may not be available on all devices. Please refer to the
10017  specific device data sheet to determine availability or use the
10018  PLIB_DMA_ExistsSuspend function in your application to automatically
10019  determine whether this feature is available.
10020 */
10021 
10022 void
10024  DMA_MODULE_ID index ) ;
10025 //******************************************************************************
10026 /* Function:
10027  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10028  Summary:
10029  DMA suspend is disabled and the DMA module operates normally.
10030  Description:
10031  This function disables the DMA suspend. The DMA module continues to operate
10032  normally.
10033  Precondition:
10034  None.
10035  Parameters:
10036  None.
10037  Returns:
10038  None.
10039  Example:
10040  <code>
10041  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10042  </code>
10043  Remarks:
10044  This function implements an operation of the Suspend feature.
10045  This feature may not be available on all devices. Please refer to the
10046  specific device data sheet to determine availability or use the
10047  PLIB_DMA_ExistsSuspend function in your application to automatically
10048  determine whether this feature is available.
10049 */
10050 
10051 void
10053  DMA_MODULE_ID index ) ;
10054 //******************************************************************************
10055 /* Function:
10056  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10057  Summary:
10058  Returns the DMA suspend status.
10059  Description:
10060  This function returns the DMA suspend status.
10061  Precondition:
10062  None.
10063  Parameters:
10064  None.
10065  Returns:
10066  - true - The DMA transfers are suspended
10067  - false - The DMA operates normally
10068  Example:
10069  <code>
10070  bool dmaSuspendStatus;
10071  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10072  </code>
10073  Remarks:
10074  This function implements an operation of the Suspend feature.
10075  This feature may not be available on all devices. Please refer to the
10076  specific device data sheet to determine availability or use the
10077  PLIB_DMA_ExistsSuspend function in your application to automatically
10078  determine whether this feature is available.
10079 */
10080 
10081 bool
10083  DMA_MODULE_ID index ) ;
10084 //******************************************************************************
10085 /* Function:
10086  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10087  Summary:
10088  DMA transfers are halted during Idle mode.
10089  Description:
10090  This function halts DMA transfers during Idle mode.
10091  Precondition:
10092  None.
10093  Parameters:
10094  None.
10095  Returns:
10096  None.
10097  Example:
10098  <code>
10099  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10100  </code>
10101  Remarks:
10102  This function implements an operation of the StopInIdle feature.
10103  This feature may not be available on all devices. Please refer to the
10104  specific device data sheet to determine availability or use the
10105  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10106  determine whether this feature is available.
10107 */
10108 
10109 void
10111  DMA_MODULE_ID index ) ;
10112 //******************************************************************************
10113 /* Function:
10114  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10115  Summary:
10116  DMA transfers continue during Idle mode.
10117  Description:
10118  This function causes DMA transfers to continue during Idle mode.
10119  Precondition:
10120  None.
10121  Parameters:
10122  None.
10123  Returns:
10124  None.
10125  Example:
10126  <code>
10127  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10128  </code>
10129  Remarks:
10130  This function implements an operation of the StopInIdle feature.
10131  This feature may not be available on all devices. Please refer to the
10132  specific device data sheet to determine availability or use the
10133  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10134  determine whether this feature is available.
10135 */
10136 
10137 void
10139  DMA_MODULE_ID index ) ;
10140 //******************************************************************************
10141 /* Function:
10142  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10143  Summary:
10144  DMA module is enabled.
10145  Description:
10146  This function enables the DMA module.
10147  Precondition:
10148  None.
10149  Parameters:
10150  None.
10151  Returns:
10152  None.
10153  Example:
10154  <code>
10155  PLIB_DMA_Enable( DMA_ID_0 );
10156  </code>
10157  Remarks:
10158  This function implements an operation of the EnableControl feature.
10159  This feature may not be available on all devices. Please refer to the
10160  specific device data sheet to determine availability or use the
10161  PLIB_DMA_ExistsEnableControl function in your application to automatically
10162  determine whether this feature is available.
10163 */
10164 
10165 void
10166  PLIB_DMA_Enable (
10167  DMA_MODULE_ID index ) ;
10168 //******************************************************************************
10169 /* Function:
10170  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10171  Summary:
10172  Returns the DMA module enable status.
10173  Description:
10174  This function returns the DMA module enable status.
10175  Precondition:
10176  None.
10177  Parameters:
10178  None.
10179  Returns:
10180  - true - The DMA is enabled
10181  - false - The DMA is disabled
10182  Example:
10183  <code>
10184  PLIB_DMA_IsEnabled( DMA_ID_0 );
10185  </code>
10186  Remarks:
10187  This function implements an operation of the EnableControl feature.
10188  This feature may not be available on all devices. Please refer to the
10189  specific device data sheet to determine availability or use the
10190  PLIB_DMA_ExistsEnableControl function in your application to automatically
10191  determine whether this feature is available.
10192 */
10193 
10194 bool
10196  DMA_MODULE_ID index ) ;
10197 //******************************************************************************
10198 /* Function:
10199  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10200  Summary:
10201  DMA module is disabled.
10202  Description:
10203  This function disables the DMA module.
10204  Precondition:
10205  None.
10206  Parameters:
10207  None.
10208  Returns:
10209  None.
10210  Example:
10211  <code>
10212  PLIB_DMA_Disable( DMA_ID_0 );
10213  </code>
10214  Remarks:
10215  This function implements an operation of the EnableControl feature.
10216  This feature may not be available on all devices. Please refer to the
10217  specific device data sheet to determine availability or use the
10218  PLIB_DMA_ExistsEnableControl function in your application to automatically
10219  determine whether this feature is available.
10220 */
10221 
10222 void
10224  DMA_MODULE_ID index ) ;
10225 // *****************************************************************************
10226 // *****************************************************************************
10227 // Section: DMA status functions
10228 // *****************************************************************************
10229 // *****************************************************************************
10230 //******************************************************************************
10231 /* Function:
10232  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10233  Summary:
10234  Returns the DMA channel bits.
10235  Description:
10236  This function returns the channel bits.
10237  Precondition:
10238  None.
10239  Parameters:
10240  None.
10241  Returns:
10242  - uint8_t - DMA channel bits
10243  Example:
10244  <code>
10245  uint8_t dmaChBits;
10246  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10247  </code>
10248  Remarks:
10249  This function implements an operation of the ChannelBits feature.
10250  This feature may not be available on all devices. Please refer to the
10251  specific device data sheet to determine availability or use the
10252  PLIB_DMA_ExistsChannelBits function in your application to automatically
10253  determine whether this feature is available.
10254 */
10255 
10256 uint8_t
10258  DMA_MODULE_ID index ) ;
10259 //******************************************************************************
10260 /* Function:
10261  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10262  Summary:
10263  Returns true if the last DMA bus access was a read.
10264  Description:
10265  This function returns true if the last DMA bus access was a read.
10266  Precondition:
10267  None.
10268  Parameters:
10269  None.
10270  Returns:
10271  - true - The last bus access was a read
10272  - false - The last bus access was not a read
10273  Example:
10274  <code>
10275  bool dmaLastBusAccessType;
10276  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10277  </code>
10278  Remarks:
10279  This function implements an operation of the LastBusAccess feature.
10280  This feature may not be available on all devices. Please refer to the
10281  specific device data sheet to determine availability or use the
10282  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10283  determine whether this feature is available.
10284 */
10285 
10286 bool
10288  DMA_MODULE_ID index ) ;
10289 //******************************************************************************
10290 /* Function:
10291  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10292  Summary:
10293  Returns true if the last DMA bus access was a write.
10294  Description:
10295  This function returns true if the last DMA bus access was a write operation.
10296  Precondition:
10297  None.
10298  Parameters:
10299  None.
10300  Returns:
10301  - true - The last bus access was a write operation
10302  - false - The last bus access was not a write operation
10303  Example:
10304  <code>
10305  bool dmaLastBusAccessType;
10306  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10307  </code>
10308  Remarks:
10309  This function implements an operation of the LastBusAccess feature.
10310  This feature may not be available on all devices. Please refer to the
10311  specific device data sheet to determine availability or use the
10312  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10313  determine whether this feature is available.
10314 */
10315 
10316 bool
10318  DMA_MODULE_ID index ) ;
10319 //******************************************************************************
10320 /* Function:
10321  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10322  Summary:
10323  Returns the address of the most recent DMA access.
10324  Description:
10325  This function returns the address of the most recent DMA access.
10326  Precondition:
10327  None.
10328  Parameters:
10329  None.
10330  Returns:
10331  - uint32_t - The most recent address accessed by the DMA
10332  Example:
10333  <code>
10334  uint32_t dmaLastAddressAccessed;
10335  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10336  </code>
10337  Remarks:
10338  This function implements an operation of the RecentAddress feature.
10339  This feature may not be available on all devices. Please refer to the
10340  specific device data sheet to determine availability or use the
10341  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10342  determine whether this feature is available.
10343 */
10344 
10345 uint32_t
10347  DMA_MODULE_ID index ) ;
10348 // *****************************************************************************
10349 // *****************************************************************************
10350 // Section: DMA Module CRC Feature Interface Functions
10351 // *****************************************************************************
10352 // *****************************************************************************
10353 //******************************************************************************
10354 /* Function:
10355  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10356  DMA_CHANNEL channel )
10357  Summary:
10358  Assigns the CRC to the specified DMA channel.
10359  Description:
10360  This function assigns the CRC feature to the specified channel.
10361  Precondition:
10362  None.
10363  Parameters:
10364  channel - One of the possible DMA channels listed by DMA_CHANNEL
10365  Returns:
10366  None.
10367  Example:
10368  <code>
10369  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10370  DMA_CHANNEL_5 );
10371  </code>
10372  Remarks:
10373  This function implements an operation of the CRCChannel feature.
10374  This feature may not be available on all devices. Please refer to the
10375  specific device data sheet to determine availability or use the
10376  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10377  determine whether this feature is available.
10378 */
10379 
10380 void
10382  DMA_MODULE_ID index ,
10383  DMA_CHANNEL channel ) ;
10384 //******************************************************************************
10385 /* Function:
10386  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10387  Summary:
10388  Returns the current DMA channel to which the CRC is assigned.
10389  Description:
10390  This function returns the current DMA channel to which the CRC is assigned.
10391  Precondition:
10392  None.
10393  Parameters:
10394  None.
10395  Returns:
10396  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10397  Example:
10398  <code>
10399  DMA_CHANNEL crcChannel;
10400  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10401  </code>
10402  Remarks:
10403  This function implements an operation of the CRCChannel feature.
10404  This feature may not be available on all devices. Please refer to the
10405  specific device data sheet to determine availability or use the
10406  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10407  determine whether this feature is available.
10408 */
10409 
10410 DMA_CHANNEL
10412  DMA_MODULE_ID index ) ;
10413 //******************************************************************************
10414 /* Function:
10415  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10416  DMA_CRC_TYPE CRCType )
10417  Summary:
10418  Selects the DMA module CRC feature type.
10419  Description:
10420  This function selects the DMA module CRC feature type. The CRC feature will
10421  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10422  checksum.
10423  Precondition:
10424  None.
10425  Parameters:
10426  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10427  Returns:
10428  None.
10429  Example:
10430  <code>
10431  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10432  DMA_CRC_IP_HEADER );
10433  </code>
10434  Remarks:
10435  This function implements an operation of the CRCType feature.
10436  This feature may not be available on all devices. Please refer to the
10437  specific device data sheet to determine availability or use the
10438  PLIB_DMA_ExistsCRCType function in your application to automatically
10439  determine whether this feature is available.
10440 */
10441 
10442 void
10444  DMA_MODULE_ID index ,
10445  DMA_CRC_TYPE CRCType ) ;
10446 //******************************************************************************
10447 /* Function:
10448  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10449  Summary:
10450  Gets the current DMA module CRC feature type.
10451  Description:
10452  This function gets the DMA module CRC feature type. The CRC feature will
10453  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10454  checksum.
10455  Precondition:
10456  None.
10457  Parameters:
10458  None.
10459  Returns:
10460  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10461  Example:
10462  <code>
10463  DMA_CRC_TYPE CRCType;
10464  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10465  </code>
10466  Remarks:
10467  This function implements an operation of the CRCType feature.
10468  This feature may not be available on all devices. Please refer to the
10469  specific device data sheet to determine availability or use the
10470  PLIB_DMA_ExistsCRCType function in your application to automatically
10471  determine whether this feature is available.
10472 */
10473 
10474 DMA_CRC_TYPE
10476  DMA_MODULE_ID index ) ;
10477 //******************************************************************************
10478 /* Function:
10479  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10480  Summary:
10481  Enables the CRC append mode.
10482  Description:
10483  This function enables the CRC append mode. The DMA transfers data from the source
10484  into the CRC, but not to the destination. When a block transfer completes, the
10485  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10486  Precondition:
10487  None.
10488  Parameters:
10489  None.
10490  Returns:
10491  None.
10492  Example:
10493  <code>
10494  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10495  </code>
10496  Remarks:
10497  This function implements an operation of the CRCAppendMode feature.
10498  This feature may not be available on all devices. Please refer to the
10499  specific device data sheet to determine availability or use the
10500  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10501  determine whether this feature is available.
10502 */
10503 
10504 void
10506  DMA_MODULE_ID index ) ;
10507 //******************************************************************************
10508 /* Function:
10509  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10510  Summary:
10511  Gets the enable status of the CRC append mode.
10512  Description:
10513  This function gets the enable status of the CRC append mode.
10514  Precondition:
10515  None.
10516  Parameters:
10517  None.
10518  Returns:
10519  - true - CRC append mode is enabled
10520  - false - CRC append mode is disabled
10521  Example:
10522  <code>
10523  bool DMAcrcAppendMode;
10524  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10525  </code>
10526  Remarks:
10527  This function implements an operation of the CRCAppendMode feature.
10528  This feature may not be available on all devices. Please refer to the
10529  specific device data sheet to determine availability or use the
10530  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10531  determine whether this feature is available.
10532 */
10533 
10534 bool
10536  DMA_MODULE_ID index ) ;
10537 //******************************************************************************
10538 /* Function:
10539  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10540  Summary:
10541  Disables the CRC append mode.
10542  Description:
10543  This function disables the CRC append mode. The DMA transfers data from the
10544  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10545  as it writes the data to the destination.
10546  Precondition:
10547  None.
10548  Parameters:
10549  None.
10550  Returns:
10551  None.
10552  Example:
10553  <code>
10554  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10555  </code>
10556  Remarks:
10557  This function implements an operation of the CRCAppendMode feature.
10558  This feature may not be available on all devices. Please refer to the
10559  specific device data sheet to determine availability or use the
10560  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10561  determine whether this feature is available.
10562 */
10563 
10564 void
10566  DMA_MODULE_ID index ) ;
10567 //******************************************************************************
10568 /* Function:
10569  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10570  Summary:
10571  Enables the DMA module CRC feature.
10572  Description:
10573  This function enables the DMA module CRC feature. The channel transfers are
10574  routed through the CRC.
10575  Precondition:
10576  None.
10577  Parameters:
10578  None.
10579  Returns:
10580  None.
10581  Example:
10582  <code>
10583  PLIB_DMA_CRCEnable( DMA_ID_0 );
10584  </code>
10585  Remarks:
10586  This function implements an operation of the CRC feature.
10587  This feature may not be available on all devices. Please refer to the
10588  specific device data sheet to determine availability or use the
10589  PLIB_DMA_ExistsCRC function in your application to automatically
10590  determine whether this feature is available.
10591 */
10592 
10593 void
10595  DMA_MODULE_ID index ) ;
10596 //******************************************************************************
10597 /* Function:
10598  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10599  Summary:
10600  Gets the enable status of the CRC feature.
10601  Description:
10602  This function gets the enable status of the CRC feature.
10603  Precondition:
10604  None.
10605  Parameters:
10606  None.
10607  Returns:
10608  - true - The CRC feature is enabled
10609  - false - The CRC feature is disabled
10610  Example:
10611  <code>
10612  bool DMAcrcStatus;
10613  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10614  </code>
10615  Remarks:
10616  This function implements an operation of the CRC feature.
10617  This feature may not be available on all devices. Please refer to the
10618  specific device data sheet to determine availability or use the
10619  PLIB_DMA_ExistsCRC function in your application to automatically
10620  determine whether this feature is available.
10621 */
10622 
10623 bool
10625  DMA_MODULE_ID index ) ;
10626 //******************************************************************************
10627 /* Function:
10628  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10629  Summary:
10630  Disables the DMA module CRC feature.
10631  Description:
10632  This function disables the DMA module CRC feature. The channel transfers proceed
10633  normally.
10634  Precondition:
10635  None.
10636  Parameters:
10637  None.
10638  Returns:
10639  None.
10640  Example:
10641  <code>
10642  PLIB_DMA_CRCDisable( DMA_ID_0 );
10643  </code>
10644  Remarks:
10645  This function implements an operation of the CRC feature.
10646  This feature may not be available on all devices. Please refer to the
10647  specific device data sheet to determine availability or use the
10648  PLIB_DMA_ExistsCRC function in your application to automatically
10649  determine whether this feature is available.
10650 */
10651 
10652 void
10654  DMA_MODULE_ID index ) ;
10655 //******************************************************************************
10656 /* Function:
10657  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10658  uint8_t polyLength )
10659  Summary:
10660  Selects the polynomial length.
10661  Description:
10662  This function Selects the polynomial length.
10663  Precondition:
10664  None.
10665  Parameters:
10666  polyLength - Polynomial length
10667  Returns:
10668  None.
10669  Example:
10670  <code>
10671  uint8_t polyLength = 0x2;
10672  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10673  </code>
10674  Remarks:
10675  This function implements an operation of the CRCPolynomialLength feature.
10676  This feature may not be available on all devices. Please refer to the
10677  specific device data sheet to determine availability or use the
10678  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10679  determine whether this feature is available.
10680 */
10681 
10682 void
10684  DMA_MODULE_ID index ,
10685  uint8_t polyLength ) ;
10686 //******************************************************************************
10687 /* Function:
10688  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10689  Summary:
10690  Gets the current polynomial length.
10691  Description:
10692  This function gets the current polynomial length.
10693  Precondition:
10694  None.
10695  Parameters:
10696  None.
10697  Returns:
10698  - uint8_t - Polynomial length
10699  Example:
10700  <code>
10701  uint8_t polyLength;
10702  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10703  </code>
10704  Remarks:
10705  This function implements an operation of the CRCPolynomialLength feature.
10706  This feature may not be available on all devices. Please refer to the
10707  specific device data sheet to determine availability or use the
10708  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10709  determine whether this feature is available.
10710 */
10711 
10712 uint8_t
10714  DMA_MODULE_ID index ) ;
10715 //******************************************************************************
10716 /* Function:
10717  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10718  DMA_CRC_BIT_ORDER bitOrder )
10719  Summary:
10720  Selects the bit order for checksum calculation.
10721  Description:
10722  This function selects the bit order for checksum calculation.
10723  Precondition:
10724  None.
10725  Parameters:
10726  bitOrder - Specifies the bit order for CRC calculation
10727  Returns:
10728  None.
10729  Example:
10730  <code>
10731  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10732  </code>
10733  Remarks:
10734  This function implements an operation of the CRCBitOrder feature.
10735  This feature may not be available on all devices. Please refer to the
10736  specific device data sheet to determine availability or use the
10737  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10738  determine whether this feature is available.
10739 */
10740 
10741 void
10743  DMA_MODULE_ID index ,
10744  DMA_CRC_BIT_ORDER bitOrder ) ;
10745 //******************************************************************************
10746 /* Function:
10747  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10748  Summary:
10749  The source data is written to the destination reordered as defined by the
10750  BYTO<1:0> bits.
10751  Description:
10752  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10753  The source data is written to the destination reordered as defined by the
10754  BYTO<1:0> bits.
10755  Precondition:
10756  None.
10757  Parameters:
10758  None.
10759  Returns:
10760  None.
10761  Example:
10762  <code>
10763  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10764  </code>
10765  Remarks:
10766  This function implements an operation of the CRCWriteByteOrder feature.
10767  This feature may not be available on all devices. Please refer to the
10768  specific device data sheet to determine availability or use the
10769  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10770  determine whether this feature is available.
10771 */
10772 
10773 void
10775  DMA_MODULE_ID index ) ;
10776 //******************************************************************************
10777 /* Function:
10778  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10779  Summary:
10780  The source data is written to the destination unaltered.
10781  Description:
10782  This function disables byte order alteration. The source data is written
10783  to the destination unaltered.
10784  Precondition:
10785  None.
10786  Parameters:
10787  None.
10788  Returns:
10789  None.
10790  Example:
10791  <code>
10792  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10793  </code>
10794  Remarks:
10795  This function implements an operation of the CRCWriteByteOrder feature.
10796  This feature may not be available on all devices. Please refer to the
10797  specific device data sheet to determine availability or use the
10798  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10799  determine whether this feature is available.
10800 */
10801 
10802 void
10804  DMA_MODULE_ID index ) ;
10805 //******************************************************************************
10806 /* Function:
10807  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10808  DMA_CRC_BYTE_ORDER byteOrder )
10809  Summary:
10810  Selects the byte order.
10811  Description:
10812  This function selects the byte order.
10813  Precondition:
10814  The WBO bit must be set to use this function.
10815  Parameters:
10816  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10817  Returns:
10818  None.
10819  Example:
10820  <code>
10821  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10822  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10823  </code>
10824  Remarks:
10825  This function implements an operation of the CRCByteOrder feature.
10826  This feature may not be available on all devices. Please refer to the
10827  specific device data sheet to determine availability or use the
10828  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10829  determine whether this feature is available.
10830 */
10831 
10832 void
10834  DMA_MODULE_ID index ,
10835  DMA_CRC_BYTE_ORDER byteOrder ) ;
10836 //******************************************************************************
10837 /* Function:
10838  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10839  Summary:
10840  Gets the current byte order selected by the DMA module CRC feature.
10841  Description:
10842  This function gets the current byte order selected by the DMA module CRC feature.
10843  Precondition:
10844  The WBO bit must be set to use this function.
10845  Parameters:
10846  None.
10847  Returns:
10848  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10849  Example:
10850  <code>
10851  DMA_CRC_BYTE_ORDER byteOrder;
10852  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10853  </code>
10854  Remarks:
10855  This function implements an operation of the CRCByteOrder feature.
10856  This feature may not be available on all devices. Please refer to the
10857  specific device data sheet to determine availability or use the
10858  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10859  determine whether this feature is available.
10860 */
10861 
10862 DMA_CRC_BYTE_ORDER
10864  DMA_MODULE_ID index ) ;
10865 //******************************************************************************
10866 /* Function:
10867  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10868  Summary:
10869  Reads the contents of the DMA CRC data register.
10870  Description:
10871  This function reads the contents of the DMA CRC data register.
10872  Precondition:
10873  None.
10874  Parameters:
10875  None.
10876  Returns:
10877  - uint32_t - 32-bit CRC data
10878  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10879  device data sheet to determine availability.
10880  Example:
10881  <code>
10882  uint32_t DMACRCdata;
10883  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10884  </code>
10885  Remarks:
10886  This function implements an operation of the CRCData feature.
10887  This feature may not be available on all devices. Please refer to the
10888  specific device data sheet to determine availability or use the
10889  PLIB_DMA_ExistsCRCData function in your application to automatically
10890  determine whether this feature is available.
10891 */
10892 
10893 uint32_t
10895  DMA_MODULE_ID index ) ;
10896 //******************************************************************************
10897 /* Function:
10898  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10899  uint32_t DMACRCdata )
10900  Summary:
10901  Writes the contents of the DMA CRC data register with the specified data.
10902  Description:
10903  This function writes the contents of the DMA CRC data register.
10904  Precondition:
10905  None.
10906  Parameters:
10907  - DMACRCdata - 32-bit CRC data
10908  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10909  device data sheet to determine availability.
10910  Returns:
10911  None.
10912  Example:
10913  <code>
10914  uint32_t DMACRCdata = 0x0E0E0E;
10915  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10916  </code>
10917  Remarks:
10918  This function implements an operation of the CRCData feature.
10919  This feature may not be available on all devices. Please refer to the
10920  specific device data sheet to determine availability or use the
10921  PLIB_DMA_ExistsCRCData function in your application to automatically
10922  determine whether this feature is available.
10923 */
10924 
10925 void
10927  DMA_MODULE_ID index ,
10928  uint32_t DMACRCdata ) ;
10929 //******************************************************************************
10930 /* Function:
10931  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10932  Summary:
10933  Reads the CRC XOR register.
10934  Description:
10935  This function reads the CRC XOR register.
10936  Precondition:
10937  None.
10938  Parameters:
10939  None.
10940  Returns:
10941  - uint32_t - 32-bit CRC XOR enable mask data
10942  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10943  device data sheet to determine availability.
10944  Example:
10945  <code>
10946  uint32_t DMACRCXORdata;
10947  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10948  </code>
10949  Remarks:
10950  This function implements an operation of the CRCXOREnable feature.
10951  This feature may not be available on all devices. Please refer to the
10952  specific device data sheet to determine availability or use the
10953  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10954  determine whether this feature is available.
10955 */
10956 
10957 uint32_t
10959  DMA_MODULE_ID index ) ;
10960 //******************************************************************************
10961 /* Function:
10962  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10963  uint32_t DMACRCXOREnableMask )
10964  Summary:
10965  Writes to the CRC XOR enable register as per the specified enable mask.
10966  Description:
10967  This function writes to the CRC XOR enable register as per the specified
10968  enable mask. Each enabled bit will be taken as input to the shift register.
10969  Precondition:
10970  None.
10971  Parameters:
10972  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10973  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10974  device data sheet to determine availability.
10975  Returns:
10976  None.
10977  Example:
10978  <code>
10979  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10980  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10981  </code>
10982  Remarks:
10983  This function implements an operation of the CRCXOREnable feature.
10984  This feature may not be available on all devices. Please refer to the
10985  specific device data sheet to determine availability or use the
10986  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10987  determine whether this feature is available.
10988 */
10989 
10990 void
10992  DMA_MODULE_ID index ,
10993  uint32_t DMACRCXOREnableMask ) ;
10994 // *****************************************************************************
10995 // *****************************************************************************
10996 // Section: DMA Address control Interface functions
10997 // *****************************************************************************
10998 // *****************************************************************************
10999 //******************************************************************************
11000 /* Function:
11001  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
11002  DMA_CHANNEL dmaChannel )
11003  Summary:
11004  Reads the source start address configured for the specified channel.
11005  Description:
11006  This function reads the source start address configured for the specified
11007  channel.
11008  Precondition:
11009  None.
11010  Parameters:
11011  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11012  Returns:
11013  - uint32_t - The source start address configured for this channel
11014  Example:
11015  <code>
11016  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11017  uint32_t SourceStartAddress;
11018  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11019  spiDMAChannel );
11020  </code>
11021  Remarks:
11022  This function implements an operation of the ChannelXSourceStartAddress feature.
11023  This feature may not be available on all devices. Please refer to the
11024  specific device data sheet to determine availability or use the
11025  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11026  determine whether this feature is available.
11027 */
11028 
11029 uint32_t
11031  DMA_MODULE_ID index ,
11032  DMA_CHANNEL dmaChannel ) ;
11033 //******************************************************************************
11034 /* Function:
11035  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11036  DMA_CHANNEL dmaChannel,
11037  uint32_t sourceStartAddress)
11038  Summary:
11039  Writes the specified source start address into the register
11040  corresponding to the specified channel.
11041  Description:
11042  This function writes the specified Source start address into the register
11043  corresponding to the specified channel.
11044  Precondition:
11045  None.
11046  Parameters:
11047  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11048  sourceStartAddress - The source start address
11049  Returns:
11050  None.
11051  Example:
11052  <code>
11053  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11054  uint32_t sourceStartAddress = 0x00FDEA00;
11055  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11056  spiDMAChannel,
11057  sourceStartAddress );
11058  </code>
11059  Remarks:
11060  This function implements an operation of the ChannelXSourceStartAddress feature.
11061  This feature may not be available on all devices. Please refer to the
11062  specific device data sheet to determine availability or use the
11063  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11064  determine whether this feature is available.
11065 */
11066 
11067 void
11069  DMA_MODULE_ID index ,
11070  DMA_CHANNEL dmaChannel ,
11071  uint32_t sourceStartAddress ) ;
11072 //******************************************************************************
11073 /* Function:
11074  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11075  DMA_CHANNEL dmaChannel )
11076  Summary:
11077  Reads the destination start address configured for the specified channel.
11078  Description:
11079  This function reads the destination start address configured for the specified
11080  channel.
11081  Precondition:
11082  None.
11083  Parameters:
11084  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11085  Returns:
11086  - uint32_t - The destination start address configured for this channel
11087  Example:
11088  <code>
11089  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11090  uint32_t DestinationStartAddress;
11091  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11092  DMA_ID_0,
11093  spiDMAChannel );
11094  </code>
11095  Remarks:
11096  This function implements an operation of the ChannelXDestinationStartAddress feature.
11097  This feature may not be available on all devices. Please refer to the
11098  specific device data sheet to determine availability or use the
11099  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11100  determine whether this feature is available.
11101 */
11102 
11103 uint32_t
11105  DMA_MODULE_ID index ,
11106  DMA_CHANNEL dmaChannel ) ;
11107 //******************************************************************************
11108 /* Function:
11109  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11110  DMA_MODULE_ID index,
11111  DMA_CHANNEL dmaChannel,
11112  uint32_t destinationStartAddress)
11113  Summary:
11114  Writes the specified destination start address into the register corresponding to
11115  the specified channel.
11116  Description:
11117  This function writes the specified destination start address into the register
11118  corresponding to the specified channel.
11119  Precondition:
11120  None.
11121  Parameters:
11122  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11123  destinationStartAddress - The destination start address
11124  Returns:
11125  None.
11126  Example:
11127  <code>
11128  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11129  uint32_t destinationStartAddress = 0x00FDEA00;
11130  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11131  spiDMAChannel,
11132  destinationStartAddress );
11133  </code>
11134  Remarks:
11135  This function implements an operation of the ChannelXDestinationStartAddress feature.
11136  This feature may not be available on all devices. Please refer to the
11137  specific device data sheet to determine availability or use the
11138  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11139  determine whether this feature is available.
11140 */
11141 
11142 void
11144  DMA_MODULE_ID index ,
11145  DMA_CHANNEL dmaChannel ,
11146  uint32_t destinationStartAddress ) ;
11147 // *****************************************************************************
11148 // *****************************************************************************
11149 // Section: DMA Data control Interface functions
11150 // *****************************************************************************
11151 // *****************************************************************************
11152 //******************************************************************************
11153 /* Function:
11154  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11155  DMA_CHANNEL dmaChannel )
11156  Summary:
11157  Reads the source size configured for the specified channel.
11158  Description:
11159  This function reads the source size configured for the specified
11160  channel.
11161  Precondition:
11162  None.
11163  Parameters:
11164  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11165  Returns:
11166  - uint16_t - The Source size configured (in bytes) for this channel.
11167  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11168  device data sheet to determine availability.
11169  Example:
11170  <code>
11171  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11172  uint16_t sourceSize;
11173  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11174  spiDMAChannel );
11175  </code>
11176  Remarks:
11177  This function implements an operation of the ChannelXSourceSize feature.
11178  This feature may not be available on all devices. Please refer to the
11179  specific device data sheet to determine availability or use the
11180  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11181  determine whether this feature is available.
11182 */
11183 
11184 uint16_t
11186  DMA_MODULE_ID index ,
11187  DMA_CHANNEL dmaChannel ) ;
11188 //******************************************************************************
11189 /* Function:
11190  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11191  DMA_CHANNEL dmaChannel,
11192  uint16_t sourceSize)
11193  Summary:
11194  Writes the specified source size into the register corresponding
11195  to the specified channel.
11196  Description:
11197  This function writes the specified source size into the register
11198  corresponding to the specified channel.
11199  Precondition:
11200  None.
11201  Parameters:
11202  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11203  sourceSize - The source size. The source size (8-bit, 16-bit) is
11204  device-specific. Please refer to the specific device data
11205  sheet to determine availability.
11206  Returns:
11207  None.
11208  Example:
11209  <code>
11210  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11211  uint16_t sourceSize = 0xA00;
11212  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11213  spiDMAChannel,
11214  sourceSize );
11215  </code>
11216  Remarks:
11217  This function implements an operation of the ChannelXSourceSize feature.
11218  This feature may not be available on all devices. Please refer to the
11219  specific device data sheet to determine availability or use the
11220  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11221  determine whether this feature is available.
11222 */
11223 
11224 void
11226  DMA_MODULE_ID index ,
11227  DMA_CHANNEL dmaChannel ,
11228  uint16_t sourceSize ) ;
11229 //******************************************************************************
11230 /* Function:
11231  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11232  DMA_CHANNEL dmaChannel )
11233  Summary:
11234  Reads the destination size configured for the specified channel.
11235  Description:
11236  This function reads the destination size configured for the specified
11237  channel.
11238  Precondition:
11239  None.
11240  Parameters:
11241  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11242  Returns:
11243  - uint16_t - The destination size configured (in bytes) for this channel.
11244  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11245  device data sheet to determine availability.
11246  Example:
11247  <code>
11248  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11249  uint16_t DestinationSize;
11250  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11251  spiDMAChannel );
11252  </code>
11253  Remarks:
11254  This function implements an operation of the ChannelXDestinationSize feature.
11255  This feature may not be available on all devices. Please refer to the
11256  specific device data sheet to determine availability or use the
11257  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11258  determine whether this feature is available.
11259 */
11260 
11261 uint16_t
11263  DMA_MODULE_ID index ,
11264  DMA_CHANNEL dmaChannel ) ;
11265 //******************************************************************************
11266 /* Function:
11267  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11268  DMA_CHANNEL dmaChannel,
11269  uint16_t destinationSize)
11270  Summary:
11271  Writes the specified destination size into the register corresponding
11272  to the specified channel.
11273  Description:
11274  This function writes the specified destination size into the register
11275  corresponding to the specified channel.
11276  Precondition:
11277  None.
11278  Parameters:
11279  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11280  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11281  is device-specific. Please refer to the specific device
11282  data sheet to determine availability.)
11283  Returns:
11284  None.
11285  Example:
11286  <code>
11287  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11288  uint16_t destinationSize = 0xA00;
11289  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11290  </code>
11291  Remarks:
11292  This function implements an operation of the ChannelXDestinationSize feature.
11293  This feature may not be available on all devices. Please refer to the
11294  specific device data sheet to determine availability or use the
11295  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11296  determine whether this feature is available.
11297 */
11298 
11299 void
11301  DMA_MODULE_ID index ,
11302  DMA_CHANNEL dmaChannel ,
11303  uint16_t destinationSize ) ;
11304 //******************************************************************************
11305 /* Function:
11306  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11307  DMA_CHANNEL dmaChannel )
11308  Summary:
11309  Reads the current byte of the source being pointed to for the specified channel.
11310  Description:
11311  This function reads the current byte of the source being pointed to for the
11312  specified channel.
11313  Precondition:
11314  None.
11315  Parameters:
11316  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11317  Returns:
11318  - uint16_t - The source byte being pointed to for this channel.
11319  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11320  device data sheet to determine availability.
11321  Example:
11322  <code>
11323  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11324  uint16_t sourcebyte;
11325  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11326  </code>
11327  Remarks:
11328  This function implements an operation of the ChannelXSourcePointer feature.
11329  This feature may not be available on all devices. Please refer to the
11330  specific device data sheet to determine availability or use the
11331  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11332  determine whether this feature is available.
11333 */
11334 
11335 uint16_t
11337  DMA_MODULE_ID index ,
11338  DMA_CHANNEL dmaChannel ) ;
11339 //******************************************************************************
11340 /* Function:
11341  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11342  DMA_CHANNEL dmaChannel )
11343  Summary:
11344  Reads the current byte of the destination being pointed to for the specified channel.
11345  Description:
11346  This function reads the current byte of the destination being pointed to for the
11347  specified channel.
11348  Precondition:
11349  None.
11350  Parameters:
11351  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11352  Returns:
11353  - uint16_t - The destination byte being pointed to for this channel.
11354  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11355  device data sheet to determine availability.
11356  Example:
11357  <code>
11358  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11359  uint16_t destinationbyte;
11360  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11361  spiDMAChannel );
11362  </code>
11363  Remarks:
11364  This function implements an operation of the ChannelXDestinationPointer feature.
11365  This feature may not be available on all devices. Please refer to the
11366  specific device data sheet to determine availability or use the
11367  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11368  determine whether this feature is available.
11369 */
11370 
11371 uint16_t
11373  DMA_MODULE_ID index ,
11374  DMA_CHANNEL dmaChannel ) ;
11375 //******************************************************************************
11376 /* Function:
11377  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11378  DMA_CHANNEL dmaChannel )
11379  Summary:
11380  Reads the cell size (in bytes) configured for the specified channel.
11381  Description:
11382  This function reads the cell size (in bytes) configured for the specified
11383  channel.
11384  Precondition:
11385  None.
11386  Parameters:
11387  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11388  Returns:
11389  - uint16_t - The cell size configured (in bytes) for this channel
11390  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11391  device data sheet to determine availability.
11392  Example:
11393  <code>
11394  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11395  uint16_t cellSize;
11396  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11397  spiDMAChannel );
11398  </code>
11399  Remarks:
11400  This function implements an operation of the ChannelXCellSize feature.
11401  This feature may not be available on all devices. Please refer to the
11402  specific device data sheet to determine availability or use the
11403  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11404  determine whether this feature is available.
11405 */
11406 
11407 uint16_t
11409  DMA_MODULE_ID index ,
11410  DMA_CHANNEL dmaChannel ) ;
11411 //******************************************************************************
11412 /* Function:
11413  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11414  DMA_CHANNEL dmaChannel,
11415  uint16_t cellSize)
11416  Summary:
11417  Writes the specified cell size into the register corresponding
11418  to the specified channel.
11419  Description:
11420  This function writes the specified cell size into the register
11421  corresponding to the specified channel.
11422  Precondition:
11423  None.
11424  Parameters:
11425  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11426  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11427  device-specific. Please refer to the specific device data
11428  sheet to determine availability.)
11429  Returns:
11430  None.
11431  Example:
11432  <code>
11433  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11434  uint16_t cellSize = 0x10;
11435  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11436  </code>
11437  Remarks:
11438  This function implements an operation of the ChannelXCellSize feature.
11439  This feature may not be available on all devices. Please refer to the
11440  specific device data sheet to determine availability or use the
11441  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11442  determine whether this feature is available.
11443 */
11444 
11445 void
11447  DMA_MODULE_ID index ,
11448  DMA_CHANNEL dmaChannel ,
11449  uint16_t CellSize ) ;
11450 //******************************************************************************
11451 /* Function:
11452  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11453  DMA_CHANNEL dmaChannel )
11454  Summary:
11455  Returns the number of bytes transferred since the last event.
11456  Description:
11457  This function returns the number of bytes transferred since the last event.
11458  Precondition:
11459  None.
11460  Parameters:
11461  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11462  Returns:
11463  - uint16_t - The number of bytes transferred since the last event.
11464  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11465  the specific device data sheet to determine availability.
11466  Example:
11467  <code>
11468  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11469  uint16_t CellProgress;
11470  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11471  spiDMAChannel );
11472  </code>
11473  Remarks:
11474  This function implements an operation of the ChannelXCellProgressPointer feature.
11475  This feature may not be available on all devices. Please refer to the
11476  specific device data sheet to determine availability or use the
11477  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11478  determine whether this feature is available.
11479 */
11480 
11481 uint16_t
11483  DMA_MODULE_ID index ,
11484  DMA_CHANNEL dmaChannel ) ;
11485 //******************************************************************************
11486 /* Function:
11487  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11488  DMA_CHANNEL dmaChannel )
11489  Summary:
11490  Returns the pattern matching (for DMA abort) data programmed for the specified
11491  channel.
11492  Description:
11493  This function returns pattern matching (for DMA abort) data programmed for
11494  the specified channel.
11495  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11496  the specific device data sheet to determine availability.)
11497  Precondition:
11498  None.
11499  Parameters:
11500  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11501  Returns:
11502  - uint16_t - The pattern matching data programmed for the current channel.
11503  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11504  the specific device data sheet to determine availability.
11505  Example:
11506  <code>
11507  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11508  uint16_t patternData;
11509  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11510  </code>
11511  Remarks:
11512  This function implements an operation of the ChannelXPatternData feature.
11513  This feature may not be available on all devices. Please refer to the
11514  specific device data sheet to determine availability or use the
11515  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11516  determine whether this feature is available.
11517 */
11518 
11519 uint16_t
11521  DMA_MODULE_ID index ,
11522  DMA_CHANNEL dmaChannel ) ;
11523 //******************************************************************************
11524 /* Function:
11525  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11526  DMA_CHANNEL dmaChannel,
11527  uint16_t patternData)
11528  Summary:
11529  Writes the specified pattern matching data (for DMA abort) into the register
11530  corresponding to the specified channel.
11531  Description:
11532  This function writes the specified pattern matching data (for DMA abort) into the
11533  register corresponding to the specified channel.
11534  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11535  the specific device data sheet to determine availability.)
11536  Precondition:
11537  None.
11538  Parameters:
11539  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11540  patternData - The pattern matching DATA programmed for the current channel
11541  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11542  the specific device data sheet to determine availability.)
11543  Returns:
11544  None.
11545  Example:
11546  <code>
11547  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11548  uint16_t patternData = '\0';
11549  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11550  </code>
11551  Remarks:
11552  This function implements an operation of the ChannelXPatternData feature.
11553  This feature may not be available on all devices. Please refer to the
11554  specific device data sheet to determine availability or use the
11555  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11556  determine whether this feature is available.
11557 */
11558 
11559 void
11561  DMA_MODULE_ID index ,
11562  DMA_CHANNEL dmaChannel ,
11563  uint16_t patternData ) ;
11564 // *****************************************************************************
11565 // *****************************************************************************
11566 // Section: DMA Interrupt Control Interface functions
11567 // *****************************************************************************
11568 // *****************************************************************************
11569 //******************************************************************************
11570 /* Function:
11571  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11572  DMA_CHANNEL dmaChannel,
11573  DMA_INT_TYPE dmaINTSource )
11574  Summary:
11575  Returns the status of the interrupt flag of the specified DMA interrupt source
11576  for the specified channel.
11577  Description:
11578  This function returns the status of the interrupt flag of the specified DMA interrupt
11579  source for the specified channel.
11580  Precondition:
11581  None.
11582  Parameters:
11583  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11584  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11585  Returns:
11586  - true - The interrupt flag is set
11587  - false - The interrupt flag is not set
11588  Example:
11589  <code>
11590  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11591  bool AddressErrorINTStatus;
11592  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11593  DMA_ID_0,
11594  spiDMAChannel,
11595  DMA_INT_ADDRESS_ERROR );
11596  </code>
11597  Remarks:
11598  This function implements an operation of the ChannelXINTSourceFlag feature.
11599  This feature may not be available on all devices. Please refer to the
11600  specific device data sheet to determine availability or use the
11601  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11602  determine whether this feature is available.
11603 */
11604 
11605 bool
11607  DMA_MODULE_ID index ,
11608  DMA_CHANNEL dmaChannel ,
11609  DMA_INT_TYPE dmaINTSource ) ;
11610 //******************************************************************************
11611 /* Function:
11612  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11613  DMA_CHANNEL dmaChannel,
11614  DMA_INT_TYPE dmaINTSource )
11615  Summary:
11616  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11617  Description:
11618  This function sets the interrupt flag of the specified DMA interrupt source for
11619  the specified channel.
11620  Precondition:
11621  None.
11622  Parameters:
11623  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11624  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11625  Returns:
11626  None.
11627  Example:
11628  <code>
11629  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11630  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11631  spiDMAChannel,
11632  DMA_INT_ADDRESS_ERROR );
11633  </code>
11634  Remarks:
11635  This function implements an operation of the ChannelXINTSourceFlag feature.
11636  This feature may not be available on all devices. Please refer to the
11637  specific device data sheet to determine availability or use the
11638  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11639  determine whether this feature is available.
11640 */
11641 
11642 void
11644  DMA_MODULE_ID index ,
11645  DMA_CHANNEL dmaChannel ,
11646  DMA_INT_TYPE dmaINTSource ) ;
11647 //******************************************************************************
11648 /* Function:
11649  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11650  DMA_CHANNEL dmaChannel,
11651  DMA_INT_TYPE dmaINTSource )
11652  Summary:
11653  Clears the interrupt flag of the specified DMA interrupt source
11654  for the specified channel.
11655  Description:
11656  This function clears the interrupt flag of the specified DMA interrupt source
11657  for the specified channel.
11658  Precondition:
11659  None.
11660  Parameters:
11661  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11662  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11663  Returns:
11664  None.
11665  Example:
11666  <code>
11667  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11668  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11669  spiDMAChannel,
11670  DMA_INT_ADDRESS_ERROR );
11671  </code>
11672  Remarks:
11673  This function implements an operation of the ChannelXINTSourceFlag feature.
11674  This feature may not be available on all devices. Please refer to the
11675  specific device data sheet to determine availability or use the
11676  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11677  determine whether this feature is available.
11678 */
11679 
11680 void
11682  DMA_MODULE_ID index ,
11683  DMA_CHANNEL dmaChannel ,
11684  DMA_INT_TYPE dmaINTSource ) ;
11685 //******************************************************************************
11686 /* Function:
11687  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11688  DMA_CHANNEL dmaChannel,
11689  DMA_INT_TYPE dmaINTSource )
11690  Summary:
11691  Enables the specified interrupt source for the specified channel.
11692  Description:
11693  This function enables the specified interrupt source for the specified channel.
11694  Precondition:
11695  None.
11696  Parameters:
11697  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11698  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11699  Returns:
11700  None.
11701  Example:
11702  <code>
11703  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11704  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11705  spiDMAChannel,
11706  DMA_INT_ADDRESS_ERROR );
11707  </code>
11708  Remarks:
11709  This function implements an operation of the ChannelXINTSource feature.
11710  This feature may not be available on all devices. Please refer to the
11711  specific device data sheet to determine availability or use the
11712  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11713  determine whether this feature is available.
11714 */
11715 
11716 void
11718  DMA_MODULE_ID index ,
11719  DMA_CHANNEL dmaChannel ,
11720  DMA_INT_TYPE dmaINTSource ) ;
11721 //******************************************************************************
11722 /* Function:
11723  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11724  DMA_CHANNEL dmaChannel,
11725  DMA_INT_TYPE dmaINTSource )
11726  Summary:
11727  Disables the specified interrupt source for the specified channel.
11728  Description:
11729  This function disables the specified interrupt source for the specified channel.
11730  Precondition:
11731  None.
11732  Parameters:
11733  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11734  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11735  Returns:
11736  None.
11737  Example:
11738  <code>
11739  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11740  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11741  spiDMAChannel,
11742  DMA_INT_ADDRESS_ERROR );
11743  </code>
11744  Remarks:
11745  This function implements an operation of the ChannelXINTSource feature.
11746  This feature may not be available on all devices. Please refer to the
11747  specific device data sheet to determine availability or use the
11748  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11749  determine whether this feature is available.
11750 */
11751 
11752 void
11754  DMA_MODULE_ID index ,
11755  DMA_CHANNEL dmaChannel ,
11756  DMA_INT_TYPE dmaINTSource ) ;
11757 //******************************************************************************
11758 /* Function:
11759  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11760  DMA_CHANNEL dmaChannel,
11761  DMA_INT_TYPE dmaINTSource )
11762  Summary:
11763  Returns the enable status of the specified interrupt source for the specified channel.
11764  Description:
11765  This function returns the enable status of the specified interrupt source for the
11766  specified channel.
11767  Precondition:
11768  None.
11769  Parameters:
11770  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11771  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11772  Returns:
11773  - true - The interrupt is enabled
11774  - false - The interrupt is not enabled
11775  Example:
11776  <code>
11777  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11778  bool dmaINTSourceEnableStatus;
11779  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11780  DMA_ID_0,
11781  spiDMAChannel,
11782  DMA_INT_ADDRESS_ERROR );
11783  </code>
11784  Remarks:
11785  This function implements an operation of the ChannelXINTSource feature.
11786  This feature may not be available on all devices. Please refer to the
11787  specific device data sheet to determine availability or use the
11788  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11789  determine whether this feature is available.
11790 */
11791 
11792 bool
11794  DMA_MODULE_ID index ,
11795  DMA_CHANNEL dmaChannel ,
11796  DMA_INT_TYPE dmaINTSource ) ;
11797 //******************************************************************************
11798 /* Function:
11799  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11800  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11801  Summary:
11802  Sets the pattern match length.
11803  Description:
11804  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11805  Precondition:
11806  None.
11807  Parameters:
11808  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11809  patternLen - Length of pattern match (either 1 or 2)
11810  Returns:
11811  None.
11812  Example:
11813  <code>
11814  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11815  DMA_PATTERN_LENGTH patternLen;
11816  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11817  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11818  </code>
11819  Remarks:
11820  This function implements an operation of the ChannelXPatternLength feature.
11821  This feature may not be available on all devices. Please refer to the
11822  specific device data sheet to determine availability or use the
11823  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11824  determine whether this feature is available.
11825 */
11826 
11827 void
11829  DMA_MODULE_ID index ,
11830  DMA_CHANNEL dmaChannel ,
11831  DMA_PATTERN_LENGTH patternLen ) ;
11832 //******************************************************************************
11833 /* Function:
11834  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11835  DMA_CHANNEL dmaChannel);
11836  Summary:
11837  Returns the pattern match length.
11838  Description:
11839  This function returns the length of the byte matching the CHPIGN bits during a
11840  pattern match that may be ignored during the pattern match determination when
11841  the CHPIGNEN bit is set.
11842  Precondition:
11843  None.
11844  Parameters:
11845  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11846  Returns:
11847  - patternLen - Length of pattern match (either 1 or 2)
11848  Example:
11849  <code>
11850  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11851  DMA_PATTERN_LENGTH patternLen;
11852  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11853  </code>
11854  Remarks:
11855  This function implements an operation of the ChannelXPatternLength feature.
11856  This feature may not be available on all devices. Please refer to the
11857  specific device data sheet to determine availability or use the
11858  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11859  determine whether this feature is available.
11860 */
11861 
11862 DMA_PATTERN_LENGTH
11864  DMA_MODULE_ID index ,
11865  DMA_CHANNEL dmaChannel ) ;
11866 //******************************************************************************
11867 /* Function:
11868  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11869  DMA_CHANNEL channel );
11870  Summary:
11871  Enables the pattern match ignore byte.
11872  Description:
11873  This function enables the pattern match ignore byte.
11874  Precondition:
11875  None.
11876  Parameters:
11877  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11878  Returns:
11879  None.
11880  Example:
11881  <code>
11882  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11883  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11884  </code>
11885  Remarks:
11886  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11887  This feature may not be available on all devices. Please refer to the
11888  specific device data sheet to determine availability or use the
11889  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11890  determine whether this feature is available.
11891 */
11892 
11893 void
11895  DMA_MODULE_ID index ,
11896  DMA_CHANNEL channel ) ;
11897 //******************************************************************************
11898 /* Function:
11899  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11900  DMA_CHANNEL channel );
11901  Summary:
11902  Returns the state of the pattern match ignore byte.
11903  Description:
11904  This function returns the state (enabled or disabled) of the pattern match
11905  ignore byte.
11906  Precondition:
11907  None.
11908  Parameters:
11909  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11910  Returns:
11911  - true - The pattern match ignore byte is enabled
11912  - false - The pattern match ignore byte is disabled
11913  Example:
11914  <code>
11915  bool patternIsEnabled;
11916  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11917  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11918  </code>
11919  Remarks:
11920  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11921  This feature may not be available on all devices. Please refer to the
11922  specific device data sheet to determine availability or use the
11923  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11924  determine whether this feature is available.
11925 */
11926 
11927 bool
11929  DMA_MODULE_ID index ,
11930  DMA_CHANNEL channel ) ;
11931 //******************************************************************************
11932 /* Function:
11933  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11934  DMA_CHANNEL channel );
11935  Summary:
11936  Disables the pattern match ignore byte.
11937  Description:
11938  This function disables the pattern match ignore byte.
11939  Precondition:
11940  None.
11941  Parameters:
11942  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11943  Returns:
11944  None.
11945  Example:
11946  <code>
11947  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11948  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11949  </code>
11950  Remarks:
11951  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11952  This feature may not be available on all devices. Please refer to the
11953  specific device data sheet to determine availability or use the
11954  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11955  determine whether this feature is available.
11956 */
11957 
11958 void
11960  DMA_MODULE_ID index ,
11961  DMA_CHANNEL channel ) ;
11962 //******************************************************************************
11963 /* Function:
11964  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11965  DMA_CHANNEL channel, uint8_t pattern );
11966  Summary:
11967  Sets the pattern match ignore value.
11968  Description:
11969  This function sets the value of the pattern match ignore.
11970  Precondition:
11971  None.
11972  Parameters:
11973  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11974  pattern - Pattern match ignore value
11975  Returns:
11976  None.
11977  Example:
11978  <code>
11979  uint8_t patternMatch = 0x8;
11980  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11981  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11982  </code>
11983  Remarks:
11984  This function implements an operation of the ChannelXPatternIgnore feature.
11985  This feature may not be available on all devices. Please refer to the
11986  specific device data sheet to determine availability or use the
11987  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11988  determine whether this feature is available.
11989 */
11990 
11991 void
11993  DMA_MODULE_ID index ,
11994  DMA_CHANNEL channel ,
11995  uint8_t pattern ) ;
11996 //******************************************************************************
11997 /* Function:
11998  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11999  DMA_CHANNEL channel );
12000  Summary:
12001  Returns the pattern match ignore value.
12002  Description:
12003  This function returns the value of the pattern match ignore.
12004  Precondition:
12005  None.
12006  Parameters:
12007  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12008  Returns:
12009  - uint8_t - Pattern match ignore value
12010  Example:
12011  <code>
12012  uint8_t patternMatch;
12013  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12014  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12015  </code>
12016  Remarks:
12017  This function implements an operation of the ChannelXPatternIgnore feature.
12018  This feature may not be available on all devices. Please refer to the
12019  specific device data sheet to determine availability or use the
12020  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12021  determine whether this feature is available.
12022 */
12023 
12024 uint8_t
12026  DMA_MODULE_ID index ,
12027  DMA_CHANNEL channel ) ;
12028 // *****************************************************************************
12029 // *****************************************************************************
12030 // Section: DMA Peripheral Library Exists API Routines
12031 // *****************************************************************************
12032 // *****************************************************************************
12033 /* The following functions indicate the existence of the features on the device.
12034 */
12035 //******************************************************************************
12036 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12037  Summary:
12038  Identifies whether the Busy feature exists on the DMA module.
12039  Description:
12040  This function identifies whether the Busy feature is available on the
12041  DMA module.
12042  When this function returns true, these functions are supported on the device:
12043  - PLIB_DMA_BusyActiveSet
12044  - PLIB_DMA_BusyActiveReset
12045  - PLIB_DMA_IsBusy
12046  Preconditions:
12047  None.
12048  Parameters:
12049  index - Identifier for the device instance
12050  Returns:
12051  - true - The Busy feature is supported on the device
12052  - false - The Busy feature is not supported on the device
12053  Remarks:
12054  None.
12055 */
12056 
12057 bool
12059  DMA_MODULE_ID index ) ;
12060 //******************************************************************************
12061 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12062  Summary:
12063  Identifies whether the Suspend feature exists on the DMA module.
12064  Description:
12065  This function identifies whether the Suspend feature is available on the
12066  DMA module.
12067  When this function returns true, these functions are supported on the device:
12068  - PLIB_DMA_SuspendEnable
12069  - PLIB_DMA_SuspendDisable
12070  - PLIB_DMA_SuspendIsEnabled
12071  Preconditions:
12072  None.
12073  Parameters:
12074  index - Identifier for the device instance
12075  Returns:
12076  - true - The Suspend feature is supported on the device
12077  - false - The Suspend feature is not supported on the device
12078  Remarks:
12079  None.
12080 */
12081 
12082 bool
12084  DMA_MODULE_ID index ) ;
12085 //******************************************************************************
12086 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12087  Summary:
12088  Identifies whether the StopInIdle feature exists on the DMA module.
12089  Description:
12090  This function identifies whether the StopInIdle feature is available on the
12091  DMA module.
12092  When this function returns true, these functions are supported on the device:
12093  - PLIB_DMA_StopInIdleEnable
12094  - PLIB_DMA_StopInIdleDisable
12095  Preconditions:
12096  None.
12097  Parameters:
12098  index - Identifier for the device instance
12099  Returns:
12100  - true - The StopInIdle feature is supported on the device
12101  - false - The StopInIdle feature is not supported on the device
12102  Remarks:
12103  None.
12104 */
12105 
12106 bool
12108  DMA_MODULE_ID index ) ;
12109 //******************************************************************************
12110 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12111  Summary:
12112  Identifies whether the EnableControl feature exists on the DMA module.
12113  Description:
12114  This function identifies whether the EnableControl feature is available on
12115  the DMA module.
12116  When this function returns true, these functions are supported on the device:
12117  - PLIB_DMA_Enable
12118  - PLIB_DMA_Disable
12119  - PLIB_DMA_IsEnabled
12120  Preconditions:
12121  None.
12122  Parameters:
12123  index - Identifier for the device instance
12124  Returns:
12125  - true - The EnableControl feature is supported on the device
12126  - false - The EnableControl feature is not supported on the device
12127  Remarks:
12128  None.
12129 */
12130 
12131 bool
12133  DMA_MODULE_ID index ) ;
12134 //******************************************************************************
12135 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12136  Summary:
12137  Identifies whether the ChannelBits feature exists on the DMA module.
12138  Description:
12139  This function identifies whether the ChannelBits feature is available on the
12140  DMA module.
12141  When this function returns true, this function is supported on the device:
12142  - PLIB_DMA_ChannelBitsGet
12143  Preconditions:
12144  None.
12145  Parameters:
12146  index - Identifier for the device instance
12147  Returns:
12148  - true - The ChannelBits feature is supported on the device
12149  - false - The ChannelBits feature is not supported on the device
12150  Remarks:
12151  None.
12152 */
12153 
12154 bool
12156  DMA_MODULE_ID index ) ;
12157 //******************************************************************************
12158 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12159  Summary:
12160  Identifies whether the LastBusAccess feature exists on the DMA module.
12161  Description:
12162  This function identifies whether the LastBusAccess feature is available on the
12163  DMA module.
12164  When this function returns true, these functions are supported on the device:
12165  - PLIB_DMA_LastBusAccessIsRead
12166  - PLIB_DMA_LastBusAccessIsWrite
12167  Preconditions:
12168  None.
12169  Parameters:
12170  index - Identifier for the device instance
12171  Returns:
12172  - true - The LastBusAccess feature is supported on the device
12173  - false - The LastBusAccess feature is not supported on the device
12174  Remarks:
12175  None.
12176 */
12177 
12178 bool
12180  DMA_MODULE_ID index ) ;
12181 //******************************************************************************
12182 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12183  Summary:
12184  Identifies whether the RecentAddress feature exists on the DMA module.
12185  Description:
12186  This function identifies whether the RecentAddress feature is available on
12187  the DMA module.
12188  When this function returns true, this function is supported on the device:
12189  - PLIB_DMA_RecentAddressAccessed
12190  Preconditions:
12191  None.
12192  Parameters:
12193  index - Identifier for the device instance
12194  Returns:
12195  - true - The RecentAddress feature is supported on the device
12196  - false - The RecentAddress feature is not supported on the device
12197  Remarks:
12198  None.
12199 */
12200 
12201 bool
12203  DMA_MODULE_ID index ) ;
12204 //******************************************************************************
12205 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12206  Summary:
12207  Identifies whether the CRCChannel feature exists on the DMA module.
12208  Description:
12209  This function identifies whether the CRCChannel feature is available on the
12210  DMA module.
12211  When this function returns true, these functions are supported on the device:
12212  - PLIB_DMA_CRCChannelSelect
12213  - PLIB_DMA_CRCChannelGet
12214  Preconditions:
12215  None.
12216  Parameters:
12217  index - Identifier for the device instance
12218  Returns:
12219  - true - The CRCChannel feature is supported on the device
12220  - false - The CRCChannel feature is not supported on the device
12221  Remarks:
12222  None.
12223 */
12224 
12225 bool
12227  DMA_MODULE_ID index ) ;
12228 //******************************************************************************
12229 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12230  Summary:
12231  Identifies whether the CRCType feature exists on the DMA module.
12232  Description:
12233  This function identifies whether the CRCType feature is available on the
12234  DMA module.
12235  When this function returns true, these functions are supported on the device:
12236  - PLIB_DMA_CRCTypeGet
12237  - PLIB_DMA_CRCTypeSet
12238  Preconditions:
12239  None.
12240  Parameters:
12241  index - Identifier for the device instance
12242  Returns:
12243  - true - The CRCType feature is supported on the device
12244  - false - The CRCType feature is not supported on the device
12245  Remarks:
12246  None.
12247 */
12248 
12249 bool
12251  DMA_MODULE_ID index ) ;
12252 //******************************************************************************
12253 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12254  Summary:
12255  Identifies whether the CRCAppendMode feature exists on the DMA module.
12256  Description:
12257  This function identifies whether the CRCAppendMode feature is available on
12258  the DMA module.
12259  When this function returns true, these functions are supported on the device:
12260  - PLIB_DMA_CRCAppendModeEnable
12261  - PLIB_DMA_CRCAppendModeDisable
12262  - PLIB_DMA_CRCAppendModeIsEnabled
12263  Preconditions:
12264  None.
12265  Parameters:
12266  index - Identifier for the device instance
12267  Returns:
12268  - true - The CRCAppendMode feature is supported on the device
12269  - false - The CRCAppendMode feature is not supported on the device
12270  Remarks:
12271  None.
12272 */
12273 
12274 bool
12276  DMA_MODULE_ID index ) ;
12277 //******************************************************************************
12278 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12279  Summary:
12280  Identifies whether the CRC feature exists on the DMA module.
12281  Description:
12282  This function identifies whether the CRC feature is available on the DMA module.
12283  When this function returns true, these functions are supported on the device:
12284  - PLIB_DMA_CRCEnable
12285  - PLIB_DMA_CRCDisable
12286  - PLIB_DMA_CRCIsEnabled
12287  Preconditions:
12288  None.
12289  Parameters:
12290  index - Identifier for the device instance
12291  Returns:
12292  - true - The CRC feature is supported on the device
12293  - false - The CRC feature is not supported on the device
12294  Remarks:
12295  None.
12296 */
12297 
12298 bool
12300  DMA_MODULE_ID index ) ;
12301 //******************************************************************************
12302 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12303  Summary:
12304  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12305  Description:
12306  This function identifies whether the CRCPolynomialLength feature is available
12307  on the DMA module.
12308  When this function returns true, these functions are supported on the device:
12309  - PLIB_DMA_CRCPolynomialLengthSet
12310  - PLIB_DMA_CRCPolynomialLengthGet
12311  Preconditions:
12312  None.
12313  Parameters:
12314  index - Identifier for the device instance
12315  Returns:
12316  - true - The CRCPolynomialLength feature is supported on the device
12317  - false - The CRCPolynomialLength feature is not supported on the device
12318  Remarks:
12319  None.
12320 */
12321 
12322 bool
12324  DMA_MODULE_ID index ) ;
12325 //******************************************************************************
12326 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12327  Summary:
12328  Identifies whether the CRCBitOrder feature exists on the DMA module.
12329  Description:
12330  This function identifies whether the CRCBitOrder feature is available on the
12331  DMA module.
12332  When this function returns true, this function is supported on the device:
12333  - PLIB_DMA_CRCBitOrderSelect
12334  Preconditions:
12335  None.
12336  Parameters:
12337  index - Identifier for the device instance
12338  Returns:
12339  - true - The CRCBitOrder feature is supported on the device
12340  - false - The CRCBitOrder feature is not supported on the device
12341  Remarks:
12342  None.
12343 */
12344 
12345 bool
12347  DMA_MODULE_ID index ) ;
12348 //******************************************************************************
12349 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12350  Summary:
12351  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12352  Description:
12353  This function identifies whether the CRCWriteByteOrder feature is available
12354  on the DMA module.
12355  When this function returns true, these functions are supported on the device:
12356  - PLIB_DMA_CRCWriteByteOrderAlter
12357  - PLIB_DMA_CRCWriteByteOrderMaintain
12358  Preconditions:
12359  None.
12360  Parameters:
12361  index - Identifier for the device instance
12362  Returns:
12363  - true - The CRCWriteByteOrder feature is supported on the device
12364  - false - The CRCWriteByteOrder feature is not supported on the device
12365  Remarks:
12366  None.
12367 */
12368 
12369 bool
12371  DMA_MODULE_ID index ) ;
12372 //******************************************************************************
12373 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12374  Summary:
12375  Identifies whether the CRCByteOrder feature exists on the DMA module.
12376  Description:
12377  This function identifies whether the CRCByteOrder feature is available on
12378  the DMA module.
12379  When this function returns true, these functions are supported on the device:
12380  - PLIB_DMA_CRCByteOrderSelect
12381  - PLIB_DMA_CRCByteOrderGet
12382  Preconditions:
12383  None.
12384  Parameters:
12385  index - Identifier for the device instance
12386  Returns:
12387  - true - The CRCByteOrder feature is supported on the device
12388  - false - The CRCByteOrder feature is not supported on the device
12389  Remarks:
12390  None.
12391 */
12392 
12393 bool
12395  DMA_MODULE_ID index ) ;
12396 //******************************************************************************
12397 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12398  Summary:
12399  Identifies whether the CRCData feature exists on the DMA module.
12400  Description:
12401  This function identifies whether the CRCData feature is available on the
12402  DMA module.
12403  When this function returns true, these functions are supported on the device:
12404  - PLIB_DMA_CRCDataRead
12405  - PLIB_DMA_CRCDataWrite
12406  Preconditions:
12407  None.
12408  Parameters:
12409  index - Identifier for the device instance
12410  Returns:
12411  - true - The CRCData feature is supported on the device
12412  - false - The CRCData feature is not supported on the device
12413  Remarks:
12414  None.
12415 */
12416 
12417 bool
12419  DMA_MODULE_ID index ) ;
12420 //******************************************************************************
12421 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12422  Summary:
12423  Identifies whether the CRCXOREnable feature exists on the DMA module.
12424  Description:
12425  This function identifies whether the CRCXOREnable feature is available on the
12426  DMA module.
12427  When this function returns true, these functions are supported on the device:
12428  - PLIB_DMA_CRCXOREnableSet
12429  - PLIB_DMA_CRCXOREnableGet
12430  Preconditions:
12431  None.
12432  Parameters:
12433  index - Identifier for the device instance
12434  Returns:
12435  - true - The CRCXOREnable feature is supported on the device
12436  - false - The CRCXOREnable feature is not supported on the device
12437  Remarks:
12438  None.
12439 */
12440 
12441 bool
12443  DMA_MODULE_ID index ) ;
12444 //******************************************************************************
12445 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12446  Summary:
12447  Identifies whether the ChannelXPriority feature exists on the DMA module.
12448  Description:
12449  This function identifies whether the ChannelXPriority feature is available on
12450  the DMA module.
12451  When this function returns true, these functions are supported on the device:
12452  - PLIB_DMA_ChannelXPrioritySelect
12453  - PLIB_DMA_ChannelXPriorityGet
12454  Preconditions:
12455  None.
12456  Parameters:
12457  index - Identifier for the device instance
12458  Returns:
12459  - true - The ChannelXPriority feature is supported on the device
12460  - false - The ChannelXPriority feature is not supported on the device
12461  Remarks:
12462  None.
12463 */
12464 
12465 bool
12467  DMA_MODULE_ID index ) ;
12468 //******************************************************************************
12469 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12470  Summary:
12471  Identifies whether the ChannelXEvent feature exists on the DMA module.
12472  Description:
12473  This function identifies whether the ChannelXEvent feature is available on
12474  the DMA module.
12475  When this function returns true, this function is supported on the device:
12476  - PLIB_DMA_ChannelXEventIsDetected
12477  Preconditions:
12478  None.
12479  Parameters:
12480  index - Identifier for the device instance
12481  Returns:
12482  - true - The ChannelXEvent feature is supported on the device
12483  - false - The ChannelXEvent feature is not supported on the device
12484  Remarks:
12485  None.
12486 */
12487 
12488 bool
12490  DMA_MODULE_ID index ) ;
12491 //******************************************************************************
12492 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12493  Summary:
12494  Identifies whether the ChannelXAuto feature exists on the DMA module.
12495  Description:
12496  This function identifies whether the ChannelXAuto feature is available on
12497  the DMA module.
12498  When this function returns true, these functions are supported on the device:
12499  - PLIB_DMA_ChannelXAutoEnable
12500  - PLIB_DMA_ChannelXAutoDisable
12501  - PLIB_DMA_ChannelXAutoIsEnabled
12502  Preconditions:
12503  None.
12504  Parameters:
12505  index - Identifier for the device instance
12506  Returns:
12507  - true - The ChannelXAuto feature is supported on the device
12508  - false - The ChannelXAuto feature is not supported on the device
12509  Remarks:
12510  None.
12511 */
12512 
12513 bool
12515  DMA_MODULE_ID index ) ;
12516 //******************************************************************************
12517 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12518  Summary:
12519  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12520  Description:
12521  This function identifies whether the ChannelXChainEnbl feature is available
12522  on the DMA module.
12523  When this function returns true, these functions are supported on the device:
12524  - PLIB_DMA_ChannelXChainEnable
12525  - PLIB_DMA_ChannelXChainDisable
12526  - PLIB_DMA_ChannelXChainIsEnabled
12527  Preconditions:
12528  None.
12529  Parameters:
12530  index - Identifier for the device instance
12531  Returns:
12532  - true - The ChannelXChainEnbl feature is supported on the device
12533  - false - The ChannelXChainEnbl feature is not supported on the device
12534  Remarks:
12535  None.
12536 */
12537 
12538 bool
12540  DMA_MODULE_ID index ) ;
12541 //******************************************************************************
12542 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12543  Summary:
12544  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12545  Description:
12546  This function identifies whether the ChannelXDisabled feature is available
12547  on the DMA module.
12548  When this function returns true, these functions are supported on the device:
12549  - PLIB_DMA_ChannelXDisabledEnablesEvents
12550  - PLIB_DMA_ChannelXDisabledDisablesEvents
12551  Preconditions:
12552  None.
12553  Parameters:
12554  index - Identifier for the device instance
12555  Returns:
12556  - true - The ChannelXDisabled feature is supported on the device
12557  - false - The ChannelXDisabled feature is not supported on the device
12558  Remarks:
12559  None.
12560 */
12561 
12562 bool
12564  DMA_MODULE_ID index ) ;
12565 //******************************************************************************
12566 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12567  Summary:
12568  Identifies whether the ChannelX feature exists on the DMA module.
12569  Description:
12570  This function identifies whether the ChannelX feature is available on the
12571  DMA module.
12572  When this function returns true, these functions are supported on the device:
12573  - PLIB_DMA_ChannelXEnable
12574  - PLIB_DMA_ChannelXIsEnabled
12575  - PLIB_DMA_ChannelXDisable
12576  Preconditions:
12577  None.
12578  Parameters:
12579  index - Identifier for the device instance
12580  Returns:
12581  - true - The ChannelX feature is supported on the device
12582  - false - The ChannelX feature is not supported on the device
12583  Remarks:
12584  None.
12585 */
12586 
12587 bool
12589  DMA_MODULE_ID index ) ;
12590 //******************************************************************************
12591 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12592  Summary:
12593  Identifies whether the ChannelXChain feature exists on the DMA module.
12594  Description:
12595  This function identifies whether the ChannelXChain feature is available on the
12596  DMA module.
12597  When this function returns true, these functions are supported on the device:
12598  - PLIB_DMA_ChannelXChainToLower
12599  - PLIB_DMA_ChannelXChainToHigher
12600  Preconditions:
12601  None.
12602  Parameters:
12603  index - Identifier for the device instance
12604  Returns:
12605  - true - The ChannelXChain feature is supported on the device
12606  - false - The ChannelXChain feature is not supported on the device
12607  Remarks:
12608  None.
12609 */
12610 
12611 bool
12613  DMA_MODULE_ID index ) ;
12614 //******************************************************************************
12615 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12616  Summary:
12617  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12618  Description:
12619  This function identifies whether the ChannelXPatternLength feature is available
12620  on the DMA module.
12621  When this function returns true, these functions are supported on the device:
12622  - PLIB_DMA_ChannelXPatternLengthSet
12623  - PLIB_DMA_ChannelXPatternLengthGet
12624  Preconditions:
12625  None.
12626  Parameters:
12627  index - Identifier for the device instance
12628  Returns:
12629  - true - The ChannelXPatternLength feature is supported on the device
12630  - false - The ChannelXPatternLength feature is not supported on the device
12631  Remarks:
12632  None.
12633 */
12634 
12635 bool
12637  DMA_MODULE_ID index ) ;
12638 //******************************************************************************
12639 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12640  Summary:
12641  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12642  module.
12643  Description:
12644  This function identifies whether the ChannelXPatternIgnoreByte feature is
12645  available on the DMA module.
12646  When this function returns true, these functions are supported on the device:
12647  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12648  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12649  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12650  Preconditions:
12651  None.
12652  Parameters:
12653  index - Identifier for the device instance
12654  Returns:
12655  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12656  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12657  Remarks:
12658  None.
12659 */
12660 
12661 bool
12663  DMA_MODULE_ID index ) ;
12664 //******************************************************************************
12665 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12666  Summary:
12667  Identifies whether the ChannelXBusy feature exists on the DMA module.
12668  Description:
12669  This function identifies whether the ChannelXBusy feature is available on the
12670  DMA module.
12671  When this function returns true, these functions are supported on the device:
12672  - PLIB_DMA_ChannelXBusyActiveSet
12673  - PLIB_DMA_ChannelXBusyInActiveSet
12674  - PLIB_DMA_ChannelXBusyIsBusy
12675  Preconditions:
12676  None.
12677  Parameters:
12678  index - Identifier for the device instance
12679  Returns:
12680  - true - The ChannelXBusy feature is supported on the device
12681  - false - The ChannelXBusy feature is not supported on the device
12682  Remarks:
12683  None.
12684 */
12685 
12686 bool
12688  DMA_MODULE_ID index ) ;
12689 //******************************************************************************
12690 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12691  Summary:
12692  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12693  Description:
12694  This function identifies whether the ChannelXPatternIgnore feature is available
12695  on the DMA module.
12696  When this function returns true, these functions are supported on the device:
12697  - PLIB_DMA_ChannelXPatternIgnoreSet
12698  - PLIB_DMA_ChannelXPatternIgnoreGet
12699  Preconditions:
12700  None.
12701  Parameters:
12702  index - Identifier for the device instance
12703  Returns:
12704  - true - The ChannelXPatternIgnore feature is supported on the device
12705  - false - The ChannelXPatternIgnore feature is not supported on the device
12706  Remarks:
12707  None.
12708 */
12709 
12710 bool
12712  DMA_MODULE_ID index ) ;
12713 //******************************************************************************
12714 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12715  Summary:
12716  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12717  Description:
12718  This function identifies whether the ChannelXTrigger feature is available on
12719  the DMA module.
12720  When this function returns true, these functions are supported on the device:
12721  - PLIB_DMA_ChannelXTriggerEnable
12722  - PLIB_DMA_ChannelXTriggerIsEnabled
12723  - PLIB_DMA_ChannelXTriggerDisable
12724  Preconditions:
12725  None.
12726  Parameters:
12727  index - Identifier for the device instance
12728  Returns:
12729  - true - The ChannelXTrigger feature is supported on the device
12730  - false - The ChannelXTrigger feature is not supported on the device
12731  Remarks:
12732  None.
12733 */
12734 
12735 bool
12737  DMA_MODULE_ID index ) ;
12738 //******************************************************************************
12739 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12740  Summary:
12741  Identifies whether the AbortTransfer feature exists on the DMA module.
12742  Description:
12743  This function identifies whether the AbortTransfer feature is available on
12744  the DMA module.
12745  When this function returns true, this function is supported on the device:
12746  - PLIB_DMA_AbortTransferSet
12747  Preconditions:
12748  None.
12749  Parameters:
12750  index - Identifier for the device instance
12751  Returns:
12752  - true - The AbortTransfer feature is supported on the device
12753  - false - The AbortTransfer feature is not supported on the device
12754  Remarks:
12755  None.
12756 */
12757 
12758 bool
12760  DMA_MODULE_ID index ) ;
12761 //******************************************************************************
12762 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12763  Summary:
12764  Identifies whether the StartTransfer feature exists on the DMA module.
12765  Description:
12766  This function identifies whether the StartTransfer feature is available on
12767  the DMA module.
12768  When this function returns true, this function is supported on the device:
12769  - PLIB_DMA_StartTransferSet
12770  Preconditions:
12771  None.
12772  Parameters:
12773  index - Identifier for the device instance
12774  Returns:
12775  - true - The StartTransfer feature is supported on the device
12776  - false - The StartTransfer feature is not supported on the device
12777  Remarks:
12778  None.
12779 */
12780 
12781 bool
12783  DMA_MODULE_ID index ) ;
12784 //******************************************************************************
12785 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12786  Summary:
12787  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12788  Description:
12789  This function identifies whether the ChannelXStartIRQ feature is available
12790  on the DMA module.
12791  When this function returns true, this function is supported on the device:
12792  - PLIB_DMA_ChannelXStartIRQSet
12793  Preconditions:
12794  None.
12795  Parameters:
12796  index - Identifier for the device instance
12797  Returns:
12798  - true - The ChannelXStartIRQ feature is supported on the device
12799  - false - The ChannelXStartIRQ feature is not supported on the device
12800  Remarks:
12801  None.
12802 */
12803 
12804 bool
12806  DMA_MODULE_ID index ) ;
12807 //******************************************************************************
12808 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12809  Summary:
12810  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12811  Description:
12812  This function identifies whether the ChannelXAbortIRQ feature is available
12813  on the DMA module.
12814  When this function returns true, this function is supported on the device:
12815  - PLIB_DMA_ChannelXAbortIRQSet
12816  Preconditions:
12817  None.
12818  Parameters:
12819  index - Identifier for the device instance
12820  Returns:
12821  - true - The ChannelXAbortIRQ feature is supported on the device
12822  - false - The ChannelXAbortIRQ feature is not supported on the device
12823  Remarks:
12824  None.
12825 */
12826 
12827 bool
12829  DMA_MODULE_ID index ) ;
12830 //******************************************************************************
12831 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12832  Summary:
12833  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12834  Description:
12835  This function identifies whether the ChannelXINTSourceFlag feature is available
12836  on the DMA module.
12837  When this function returns true, these functions are supported on the device:
12838  - PLIB_DMA_ChannelXINTSourceFlagGet
12839  - PLIB_DMA_ChannelXINTSourceFlagSet
12840  - PLIB_DMA_ChannelXINTSourceFlagClear
12841  Preconditions:
12842  None.
12843  Parameters:
12844  index - Identifier for the device instance
12845  Returns:
12846  - true - The ChannelXINTSourceFlag feature is supported on the device
12847  - false - The ChannelXINTSourceFlag feature is not supported on the device
12848  Remarks:
12849  None.
12850 */
12851 
12852 bool
12854  DMA_MODULE_ID index ) ;
12855 //******************************************************************************
12856 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12857  Summary:
12858  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12859  Description:
12860  This function identifies whether the ChannelXINTSource feature is available
12861  on the DMA module.
12862  When this function returns true, these functions are supported on the device:
12863  - PLIB_DMA_ChannelXINTSourceEnable
12864  - PLIB_DMA_ChannelXINTSourceDisable
12865  - PLIB_DMA_ChannelXINTSourceIsEnabled
12866  Preconditions:
12867  None.
12868  Parameters:
12869  index - Identifier for the device instance
12870  Returns:
12871  - true - The ChannelXINTSource feature is supported on the device
12872  - false - The ChannelXINTSource feature is not supported on the device
12873  Remarks:
12874  None.
12875 */
12876 
12877 bool
12879  DMA_MODULE_ID index ) ;
12880 //******************************************************************************
12881 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12882  Summary:
12883  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12884  Description:
12885  This function identifies whether the ChannelXSourceStartAddress feature is available
12886  on the DMA module.
12887  When this function returns true, these functions are supported on the device:
12888  - PLIB_DMA_ChannelXSourceStartAddressGet
12889  - PLIB_DMA_ChannelXSourceStartAddressSet
12890  Preconditions:
12891  None.
12892  Parameters:
12893  index - Identifier for the device instance
12894  Returns:
12895  - true - The ChannelXSourceStartAddress feature is supported on the device
12896  - false - The ChannelXSourceStartAddress feature is not supported on the device
12897  Remarks:
12898  None.
12899 */
12900 
12901 bool
12903  DMA_MODULE_ID index ) ;
12904 //******************************************************************************
12905 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12906  Summary:
12907  Identifies whether the ChannelXDestinationStartAddress feature exists on
12908  the DMA module.
12909  Description:
12910  This function identifies whether the ChannelXDestinationStartAddress feature
12911  is available on the DMA module.
12912  When this function returns true, these functions are supported on the device:
12913  - PLIB_DMA_ChannelXDestinationStartAddressGet
12914  - PLIB_DMA_ChannelXDestinationStartAddressSet
12915  Preconditions:
12916  None.
12917  Parameters:
12918  index - Identifier for the device instance
12919  Returns:
12920  - true - The ChannelXDestinationStartAddress feature is supported on the device
12921  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12922  Remarks:
12923  None.
12924 */
12925 
12926 bool
12928  DMA_MODULE_ID index ) ;
12929 //******************************************************************************
12930 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12931  Summary:
12932  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12933  Description:
12934  This function identifies whether the ChannelXSourceSize feature is available
12935  on the DMA module.
12936  When this function returns true, these functions are supported on the device:
12937  - PLIB_DMA_ChannelXSourceSizeGet
12938  - PLIB_DMA_ChannelXSourceSizeSet
12939  Preconditions:
12940  None.
12941  Parameters:
12942  index - Identifier for the device instance
12943  Returns:
12944  - true - The ChannelXSourceSize feature is supported on the device
12945  - false - The ChannelXSourceSize feature is not supported on the device
12946  Remarks:
12947  None.
12948 */
12949 
12950 bool
12952  DMA_MODULE_ID index ) ;
12953 //******************************************************************************
12954 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12955  Summary:
12956  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12957  Description:
12958  This function identifies whether the ChannelXDestinationSize feature is available
12959  on the DMA module.
12960  When this function returns true, these functions are supported on the device:
12961  - PLIB_DMA_ChannelXDestinationSizeGet
12962  - PLIB_DMA_ChannelXDestinationSizeSet
12963  Preconditions:
12964  None.
12965  Parameters:
12966  index - Identifier for the device instance
12967  Returns:
12968  - true - The ChannelXDestinationSize feature is supported on the device
12969  - false - The ChannelXDestinationSize feature is not supported on the device
12970  Remarks:
12971  None.
12972 */
12973 
12974 bool
12976  DMA_MODULE_ID index ) ;
12977 //******************************************************************************
12978 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12979  Summary:
12980  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12981  Description:
12982  This function identifies whether the ChannelXSourcePointer feature is available
12983  on the DMA module.
12984  When this function returns true, this function is supported on the device:
12985  - PLIB_DMA_ChannelXSourcePointerGet
12986  Preconditions:
12987  None.
12988  Parameters:
12989  index - Identifier for the device instance
12990  Returns:
12991  - true - The ChannelXSourcePointer feature is supported on the device
12992  - false - The ChannelXSourcePointer feature is not supported on the device
12993  Remarks:
12994  None.
12995 */
12996 
12997 bool
12999  DMA_MODULE_ID index ) ;
13000 //******************************************************************************
13001 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
13002  Summary:
13003  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
13004  Description:
13005  This function identifies whether the ChannelXDestinationPointer feature is available
13006  on the DMA module.
13007  When this function returns true, this function is supported on the device:
13008  - PLIB_DMA_ChannelXDestinationPointerGet
13009  Preconditions:
13010  None.
13011  Parameters:
13012  index - Identifier for the device instance
13013  Returns:
13014  - true - The ChannelXDestinationPointer feature is supported on the device
13015  - false - The ChannelXDestinationPointer feature is not supported on the device
13016  Remarks:
13017  None.
13018 */
13019 
13020 bool
13022  DMA_MODULE_ID index ) ;
13023 //******************************************************************************
13024 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13025  Summary:
13026  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13027  Description:
13028  This function identifies whether the ChannelXCellSize feature is available on
13029  the DMA module.
13030  When this function returns true, these functions are supported on the device:
13031  - PLIB_DMA_ChannelXCellSizeGet
13032  - PLIB_DMA_ChannelXCellSizeSet
13033  Preconditions:
13034  None.
13035  Parameters:
13036  index - Identifier for the device instance
13037  Returns:
13038  - true - The ChannelXCellSize feature is supported on the device
13039  - false - The ChannelXCellSize feature is not supported on the device
13040  Remarks:
13041  None.
13042 */
13043 
13044 bool
13046  DMA_MODULE_ID index ) ;
13047 //******************************************************************************
13048 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13049  Summary:
13050  Identifies whether the ChannelXCellProgressPointer feature exists on the
13051  DMA module.
13052  Description:
13053  This function identifies whether the ChannelXCellProgressPointer feature is
13054  available on the DMA module.
13055  When this function returns true, this function is supported on the device:
13056  - PLIB_DMA_ChannelXCellProgressPointerGet
13057  Preconditions:
13058  None.
13059  Parameters:
13060  index - Identifier for the device instance
13061  Returns:
13062  - true - The ChannelXCellProgressPointer feature is supported on the device
13063  - false - The ChannelXCellProgressPointer feature is not supported on the device
13064  Remarks:
13065  None.
13066 */
13067 
13068 bool
13070  DMA_MODULE_ID index ) ;
13071 //******************************************************************************
13072 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13073  Summary:
13074  Identifies whether the ChannelXPatternData feature exists on the DMA module
13075  Description:
13076  This function identifies whether the ChannelXPatternData feature is available
13077  on the DMA module.
13078  When this function returns true, these functions are supported on the device:
13079  - PLIB_DMA_ChannelXPatternDataGet
13080  - PLIB_DMA_ChannelXPatternDataSet
13081  Preconditions:
13082  None.
13083  Parameters:
13084  index - Identifier for the device instance
13085  Returns:
13086  - true - The ChannelXPatternData feature is supported on the device
13087  - false - The ChannelXPatternData feature is not supported on the device
13088  Remarks:
13089  None.
13090 */
13091 
13092 bool
13094  DMA_MODULE_ID index ) ;
13095 //DOM-IGNORE-BEGIN
13096 //DOM-IGNORE-END
13097  // #ifndef _PLIB_DMA_H
13098 /*******************************************************************************
13099  End of File
13100 */
13101 
13102 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13103 /* CLOSE_FILE Include File */
13104 
13105 // *****************************************************************************
13106 // *****************************************************************************
13107 // Section: Data Types
13108 // *****************************************************************************
13109 // *****************************************************************************
13110 // *****************************************************************************
13111 /* DMA System Service Channel None
13112  Summary:
13113  DMA channel none
13114  Description:
13115  This constant identifies the specification of no choice from client
13116  for allocating a particular DMA channel.
13117  Remarks:
13118  This constant should be used in place of hard-coded numeric literals.
13119 */
13120 //DOM-IGNORE-BEGIN
13121 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13122 //DOM-IGNORE-END
13123 // *****************************************************************************
13124 /* DMA System Service Channel Any
13125  Summary:
13126  Identifies the client specification to allocate any available DMA channel.
13127  Description:
13128  This constant identifies the specification by the client
13129  to allocate any available DMA channel.
13130  Remarks:
13131  This constant should be used in place of hard-coded numeric literals.
13132 */
13133 //DOM-IGNORE-BEGIN
13134 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13135 //DOM-IGNORE-END
13136 // *****************************************************************************
13137 /* DMA System Service Channel Count
13138  Summary:
13139  Identifies the maximum number of DMA channel handles to be defined.
13140  Description:
13141  This constant identifies the maximum number of DMA channel handles
13142  that should be defined.
13143  Remarks:
13144  This value is derived from device-specific header files defined as
13145  part of the peripheral libraries.
13146 */
13147 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13148 // *****************************************************************************
13149 /* DMA System Service Channel Handle
13150  Summary:
13151  Assigns the handle for requested channel.
13152  Description:
13153  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13154  function. This handle is associated with the channel number that is used for
13155  data transfer and it allows the application to track the data transfer.
13156  The channel handle once assigned to a client expires when the
13157  client calls SYS_DMA_ChannelRelease.
13158  exits.
13159  Remarks:
13160  None.
13161 */
13162 
13163 typedef
13164 uintptr_t
13166 // *****************************************************************************
13167 /* DMA System Service Invalid Channel Handle
13168  Summary:
13169  Defines an invalid channel handle.
13170  Description:
13171  This is the definition of an invalid channel handle. An invalid buffer handle
13172  is returned by SYS_DMA_ChannelAllocate function if the channel number
13173  request was not successful.
13174  Remarks:
13175  None.
13176 */
13177 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13178 // *****************************************************************************
13179 /* DMA stop in idle mode
13180  Summary:
13181  Enable/Disable DMA operations in Idle mode.
13182  Description:
13183  This data type allows enabling/disabling of DMA operations in idle mode.
13184  Remarks:
13185  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13186  while initializing the DMA module by calling SYS_DMA_Initialize.
13187  This feature may not be available on all devices. Refer to the specific device
13188  data sheet to determine availability.
13189 */
13190 
13191 typedef
13192  enum
13193  {
13194  /* When the CPU enters idle mode, the DMA module continue operations */
13196  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13198  } SYS_DMA_SIDL ;
13199 // *****************************************************************************
13200 /* DMA Channel chaining priority
13201  Summary:
13202  Identifies the priority of chaining channel.
13203  Description:
13204  This data type identifies the priority of chaining channel.
13205  Channel chaining priority identifies the channel that will be enabled
13206  on completion of block data transfer on the master channel.
13207  Remarks:
13208  None.
13209 */
13210 
13211 typedef
13212  enum
13213  {
13214  /* Chain to channel higher in natural priority */
13216  /* Chain to channel lower in natural priority */
13219 // *****************************************************************************
13220 /* DMA Channel ignore pattern match
13221  Summary:
13222  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13223  pattern.
13224  Description:
13225  This data type allows enabling/disabling the feature to ignore a byte
13226  between a 2-byte match abort pattern.
13227  Remarks:
13228  This feature may not be available on all devices. Refer to the specific device
13229  data sheet to determine availability.
13230 */
13231 
13232 typedef
13233  enum
13234  {
13235  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13237  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13240 // *****************************************************************************
13241 /* DMA channel CRC mode
13242  Summary:
13243  Identifies the operation mode of the CRC module.
13244  Description:
13245  This data type identifies CRC operating mode. The CRC computation can be
13246  in background mode or append mode.
13247  Remarks:
13248  None.
13249 */
13250 
13251 typedef
13252  enum
13253  {
13254  /* DMA reads the data from the source, passes it through the CRC module and
13255  writes it to the destination. the calculated CRC is left in the DCRCDATA
13256  register at the end of the block transfer. */
13258  /* DMA only feeds source data to the CRC module. it does not write source data
13259  to the destination address. When a block transfer complete or pattern abort
13260  event occur, The DMA writes the CRC value to the destination address */
13263 // *****************************************************************************
13264 /* DMA channel CRC write order
13265  Summary:
13266  Identifies altering/maintaining write order post CRC computation.
13267  Description:
13268  This data type identifies write byte order selection post CRC
13269  computation.
13270  Remarks:
13271  None.
13272 */
13273 
13274 typedef
13275  enum
13276  {
13277  /* Source data is written to the destination unchanged regardless
13278  of the selected pre-CRC byte order. */
13280  /* Source data is written to the destination reordered according
13281  to the selected pre-CRC byte order. */
13284 // *****************************************************************************
13285 /* DMA channel operation modes
13286  Summary:
13287  Identifies the available DMA operating modes.
13288  Description:
13289  This data type Identifies the available DMA operating modes.
13290  The supported DMA modes are not mutually exclusive, but can be simultaneously
13291  operational.
13292  Remarks:
13293  These supported DMA modes can be logically OR'd together. They are passed
13294  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13295 */
13296 
13297 typedef
13298  enum
13299  {
13300  /* The normal DMA operation mode. The DMA channel will transfer data from
13301  a source to a destination without CPU intervention */
13302  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13303  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13304  ,
13305  /* Pattern Match abort mode allows the user to end a transfer if data
13306  written during a transaction matches a specific pattern, as defined by
13307  the DCHxDAT register */
13309  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13310  ,
13311  /* Channel chaining operating mode enhances the normal DMA channel
13312  operations. A channel(slave) can be chained to an adjacent channel(master).
13313  The slave channel will be enabled when a block transfer of the master
13314  channel completes. */
13315  /* only one of the below two chaining priorities must be provided.
13316  Chaining priority High. */
13318  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13319  ,
13320  /* Chaining priority Low */
13322  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13323  ,
13324  /* Auto enable operating mode allows a channel to be kept active, even if a
13325  block transfer completes or pattern match occurs. This prevents the user
13326  from having to re-enable the channel each time a block transfer completes. */
13327  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13328  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13329  ,
13330  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13331  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13332  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13334 // *****************************************************************************
13335 /* DMA channel CRC mode
13336  Summary:
13337  Defines the attributes for CRC operation mode.
13338  Description:
13339  This data type defines the attributes for CRC operation mode.
13340  Remarks:
13341  This feature may not be available on all devices. Refer to the specific device
13342  data sheet to determine availability.
13343 */
13344 
13345 typedef
13346  struct
13347  {
13348  /* CRC type (PLIB-level).
13349  Type Selection identifies whether the CRC module will calculate an IP
13350  header checksum or an LFSR CRC */
13351  DMA_CRC_TYPE type ;
13352  /* CRC mode, Background or Append */
13354  /* Polynomial length, This value is redundant when the selected CRC type is
13355  IP header checksum. When the CRC type is LFSR, Identifies the length of
13356  the polynomial. */
13357  uint8_t polyLength ;
13358  /* Bit order (PLIB-level).
13359  Identifies whether the CRC is computed LSb or MSb first */
13360  DMA_CRC_BIT_ORDER bitOrder ;
13361  /* Byte order (PLIB-level).
13362  Identifies the byte selection order input pre-CRC Generator. */
13363  DMA_CRC_BYTE_ORDER byteOrder ;
13364  /* Post CRC Write order */
13365  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13366  /* CRC data feed: While enabling the CRC mode, this field gives
13367  the seed for the CRC computation. On block transfer complete or
13368  pattern match abort the field have the computed CRC. */
13369  uint32_t data ;
13370  /* XOR bit mask, This value is redundant when the selected CRC type is
13371  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13372  bit mask input to the shift register during CRC computation. */
13373  uint32_t xorBitMask ;
13375 // *****************************************************************************
13376 /* DMA System service Events
13377  Summary:
13378  Enumeration of possible DMA System service events.
13379  Description:
13380  This data type provides an enumeration of all possible DMA System service events.
13381  Remarks:
13382  None.
13383 */
13384 
13385 typedef
13386  enum
13387  {
13388  /* Data was transferred successfully. */
13390  /* Error while processing the request */
13392  /* Data transfer was aborted. */
13394  /* No events yet. */
13397 // *****************************************************************************
13398 /* DMA System service Error
13399  Summary:
13400  Indicates the error information for the DMA System service.
13401  Description:
13402  This enumeration indicates the error information for the DMA System service.
13403  Remarks:
13404  None.
13405 */
13406 
13407 typedef
13408  enum
13409  {
13410  /* Data was transferred successfully. */
13411  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13412  = 1 << 0 ,
13413  /* DOM-IGNORE-END*/
13414  /* DMA address error. */
13415  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13416  = 1 << 1 /* DOM-IGNORE-END*/
13417  } SYS_DMA_ERROR ;
13418 // *****************************************************************************
13419 /* DMA Initialization data
13420  Summary:
13421  Defines the data required to initialize the DMA subsystem.
13422  Description:
13423  This data type defines the data required to initialize the DMA subsystem.
13424  Remarks:
13425  This feature may not be available on all devices. Refer to the specific device
13426  data sheet to determine availability.
13427 */
13428 
13429 typedef
13430  struct
13431  {
13432  /* Enable/Disable stop in idle mode feature */
13433  SYS_DMA_SIDL sidl ;
13434  } SYS_DMA_INIT ;
13435 // *****************************************************************************
13436 /* Data width options */
13437 
13438 typedef
13439  enum
13440  {
13441  /* Data width configuration feature is not available */
13443  } SYS_DMA_DATA_WIDTH ;
13444 // *****************************************************************************
13445 /* DMA descriptor control
13446  Summary:
13447  Defines the descriptor control for linked list operation.
13448  Description:
13449  This data type defines the descriptor control for linked list operation.
13450  Remarks:
13451  This feature may not be available on all devices. Refer to the specific device
13452  data sheet to determine availability.
13453 */
13454 
13455 typedef
13456  union
13457  {
13458  /* Feature is not supported */
13459  ;
13461 // *****************************************************************************
13462 // *****************************************************************************
13463 // Section: Initialization and Task Functions
13464 // *****************************************************************************
13465 // *****************************************************************************
13466 //******************************************************************************
13467 /* Function:
13468  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13469  Summary:
13470  Maintains the system service's state machine.
13471 
13472  Description:
13473  This function is used to maintain the DMA system service's internal state
13474  machine. This function services events on a specific DMA channel.
13475  Precondition:
13476  DMA should have been initialized by calling SYS_DMA_Initialize.
13477  Parameters:
13478  object - Object handle for the DMA module (returned from
13479  SYS_DMA_Initialize)
13480  activeChannel - DMA channel number to be serviced.
13481  Returns:
13482  None.
13483  Example:
13484  <code>
13485  // 'object' Returned from SYS_DMA_Initialize
13486  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13487  {
13488  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13489  }
13490  </code>
13491  Remarks:
13492  This function is normally not called directly by an application. It is
13493  called by the system's task/interrupt routines.
13494  */
13495 
13496 void
13497  SYS_DMA_Tasks (
13498  SYS_MODULE_OBJ object ,
13499  DMA_CHANNEL activeChannel ) ;
13500 //******************************************************************************
13501 /* For backward compatibility */
13502 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13503  // #ifndef _SYS_DMA_DEFINITIONS_H
13504 /*******************************************************************************
13505  End of File
13506 */
13507 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13508 /* CLOSE_FILE Include File */
13509 
13510 // DOM-IGNORE-BEGIN
13511 // DOM-IGNORE-END
13512 // *****************************************************************************
13513 // *****************************************************************************
13514 // Section: DMA System Service Interface Routines
13515 // *****************************************************************************
13516 // *****************************************************************************
13517 // *****************************************************************************
13518 /* DMA System service Transfer Event Handler Function
13519  Summary:
13520  Pointer to a DMA System service Transfer Event handler function.
13521  Description:
13522  This data type defines a DMA System service Transfer Event Handler Function.
13523  A DMA system service client must register an transfer event handler function of
13524  this type to receive transfer related events from the system service.
13525  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13526  was transferred successfully. The channelHandle parameter contains the channel
13527  handle of the channel on which the transfer was processed.
13528  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13529  not transferred successfully. TThe channelHandle parameter contains the channel
13530  handle of the channel on which the transfer had failed.
13531  The contextHandle parameter contains the context handle that was provided by
13532  the client at the time of registering the event handler. This context handle
13533  can be anything that the client consider helpful or necessary to identify
13534  the client context object associated with the channel of the system
13535  service that generated the event.
13536  The event handler function executes in an interrupt context when DMA is setup
13537  to start operation by an interrupt trigger source. It is recommended of the
13538  application to not perform process intensive operations with in this
13539  function.
13540  Remarks:
13541  None.
13542 */
13543 
13544 typedef
13546 SYS_DMA_CHANNEL_HANDLE handle ,
13547 uintptr_t contextHandle ) ;
13548 // *****************************************************************************
13549 // *****************************************************************************
13550 // Section: Initialization and Task Functions
13551 // *****************************************************************************
13552 // *****************************************************************************
13553 //******************************************************************************
13554 /* Function:
13555  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13556  Summary:
13557  Initializes and Enables the DMA Controller.
13558  Description:
13559  This function Enables the DMA module. Enable/Disable stop in idle mode
13560  feature based on the passed parameter value.
13561  This function initializes the DMA module making it ready for clients to
13562  open and use it. The initialization data is specified by the init parameter.
13563  Precondition:
13564  None.
13565  Parameters:
13566  init - Pointer to the data structure containing any data
13567  necessary to initialize the hardware. This pointer may
13568  be null if no data is required and default
13569  initialization is to be used.
13570  Returns:
13571  If successful, returns a valid handle to the DMA module object.
13572  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13573  Example:
13574  <code>
13575  SYS_MODULE_OBJ objectHandle;
13576  SYS_DMA_INIT initParam;
13577  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13578  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13579  (SYS_MODULE_INIT*)initParam);
13580  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13581  {
13582  // Handle error
13583  }
13584  </code>
13585  Remarks:
13586  This function must be called before any other DMA systems service routines
13587  are called.
13588  Not all features are available on all micro-controllers.
13589 */
13590 
13591 SYS_MODULE_OBJ
13593  const SYS_MODULE_INIT * const init ) ;
13594 // *****************************************************************************
13595 // *****************************************************************************
13596 // Section: Channel Setup and management functions
13597 // *****************************************************************************
13598 // *****************************************************************************
13599 //******************************************************************************
13600 /* Function:
13601  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13602  Summary:
13603  Allocates the specified DMA channel and returns a handle to it.
13604  Description:
13605  This function opens the specified DMA channel and provides a
13606  handle that must be provided to all other client-level operations to
13607  identify the caller and the DMA channel.
13608  Precondition:
13609  Function SYS_DMA_Initialize must have been called before calling this
13610  function.
13611  Parameters:
13612  channel - Channel number requested for allocation.
13613  When channel number specified is DMA_CHANNEL_ANY
13614  a random channel is allocated for DMA transfers.
13615  Returns:
13616  The channel handle for the requested channel number.
13617  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13618  Error can occur.
13619  - if the requested channel number is invalid.
13620  - if the requested channel number is not free.
13621  Example:
13622  <code>
13623  DMA_CHANNEL channel;
13624  SYS_DMA_CHANNEL_HANDLE handle
13625  channel = DMA_CHANNEL_2;
13626  handle = SYS_DMA_ChannelAllocate(channel);
13627  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13628  {
13629  // Failed to allocate the channel
13630  }
13631  else
13632  {
13633  // Proceed with setting up the channel and adding the transfer
13634  }
13635  </code>
13636  Remarks:
13637  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13638  This function must be called before any other DMA channel Setup and management
13639  routines are called
13640 */
13641 
13644  DMA_CHANNEL channel ) ;
13645 //******************************************************************************
13646 /* Function:
13647  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13648  Summary:
13649  Deallocates and frees the channel specified by the handle.
13650  Description:
13651  This function deallocates an allocated-channel of the DMA module,
13652  invalidating the handle.
13653  Precondition:
13654  DMA should have been initialized by calling SYS_DMA_Initialize.
13655  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13656  Parameters:
13657  handle - A valid allocated-channel handle, returned from the service's
13658  Allocate routine
13659  Returns:
13660  None.
13661  Example:
13662  <code>
13663  DMA_CHANNEL channel;
13664  SYS_DMA_CHANNEL_HANDLE handle;
13665  channel = DMA_CHANNEL_2;
13666  handle = SYS_DMA_ChannelAllocate(channel);
13667  SYS_DMA_ChannelRelease(handle);
13668  </code>
13669  Remarks:
13670  After calling this routine, the handle passed in "handle" must not be used
13671  with any of the remaining service's routines. A new handle must be obtained by
13672  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13673 */
13674 
13675 void
13677  SYS_DMA_CHANNEL_HANDLE handle ) ;
13678 //******************************************************************************
13679 /* Function:
13680  void SYS_DMA_ChannelSetup
13681  (
13682  SYS_DMA_CHANNEL_HANDLE handle,
13683  SYS_DMA_CHANNEL_OP_MODE modeEnable
13684  DMA_TRIGGER_SOURCE eventSrc
13685  )
13686  Summary:
13687  Setup the DMA channel parameters.
13688  Description:
13689  This function sets up the DMA channel parameters.
13690  It sets the channel priority and enables the mode of operations for the
13691  current system design.
13692  Precondition:
13693  DMA should have been initialized by calling SYS_DMA_Initialize.
13694  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13695  Parameters:
13696  handle - Handle of the DMA channel as returned by the
13697  SYS_DMA_ChannelAllocate function.
13698  priority - The priority to be associated to the channel.
13699  modeEnable - The supported operating modes to be enabled.
13700  This parameter can be logically ORed to specify
13701  multiple options.
13702  eventSrc - The event causing the cell transfer start.
13703  Returns:
13704  None.
13705  Example:
13706  <code>
13707  // 'handle' is a valid handle returned
13708  // by the SYS_DMA_ChannelAllocate function.
13709  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13710  DMA_TRIGGER_SOURCE eventSrc;
13711  channel = DMA_CHANNEL_2;
13712  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13713  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13714  // Setup channel number, and enables basic and CRC mode
13715  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13716  </code>
13717  Remarks:
13718  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13719  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13720  mode setup API's needs to be called to set the related parameters.
13721  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13722  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13723  Not all features are available on all microcontrollers.
13724  */
13725 
13726 void
13728  SYS_DMA_CHANNEL_HANDLE handle ,
13729  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13730  DMA_TRIGGER_SOURCE eventSrc ) ;
13731 //******************************************************************************
13732 /* Function:
13733  void SYS_DMA_ChannelSetupMatchAbortMode
13734  (
13735  SYS_DMA_CHANNEL_HANDLE handle,
13736  uint16_t pattern,
13737  DMA_PATTERN_LENGTH length,
13738  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13739  uint8_t ignorePattern
13740  )
13741  Summary:
13742  Setup the pattern match abort mode.
13743  Description:
13744  This function sets up the termination of DMA operation when the specified
13745  pattern is matched. Additionally on supported parts the function also
13746  sets up the ignoring of part of a pattern(8-bit) from match abort
13747  pattern(16-bit).
13748  Precondition:
13749  DMA should have been initialized by calling SYS_DMA_Initialize.
13750  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13751  The function SYS_DMA_ChannelSetup must be called to enable
13752  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13753  match mode features.
13754  Parameters:
13755  handle - Handle of the DMA channel as returned by the
13756  SYS_DMA_ChannelAllocate function.
13757  pattern - The pattern that needs to be matched to abort a DMA transfer.
13758  length - Match pattern length can be 1-byte or 2-byte.
13759  ignore - Enable/Disable a byte between a 2-byte pattern match.
13760  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13761  from the match abort pattern(16-bit)
13762  Returns:
13763  None.
13764  Example:
13765  <code>
13766  // Example 1
13767  // The following code is for a device with an 8-bit pattern value and no
13768  // support for pattern match ignore feature
13769  // 'handle' is a valid handle returned
13770  // by the SYS_DMA_ChannelAllocate function.
13771  uint16_t pattern;
13772  DMA_PATTERN_LENGTH length;
13773  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13774  uint8_t ignorePattern;
13775  pattern = 0x00; //Stop transfer on detection of a NULL character
13776  length = DMA_PATTERN_LENGTH_NONE;
13777  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13778  ignorePattern = 0;
13779  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13780  ignoreEnable, ignorePattern);
13781  // Example 2
13782  // The following code is for a device with a 16-bit pattern value and
13783  // support for pattern match ignore feature
13784  // 'handle' is a valid handle returned
13785  // by the SYS_DMA_ChannelAllocate function.
13786  uint16_t pattern;
13787  DMA_PATTERN_LENGTH length;
13788  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13789  uint8_t ignorePattern;
13790  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13791  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13792  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13793  ignorePattern = 0x00; \\ Any null character between the termination pattern
13794  \\ '\r' and '\n' is ignored.
13795  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13796  ignore, ignorePattern);
13797  </code>
13798  Remarks:
13799  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13800  Not all features are available on all devices.
13801  Refer to the specific device data sheet for details.
13802 */
13803 
13804 void
13806  SYS_DMA_CHANNEL_HANDLE handle ,
13807  uint16_t pattern ,
13808  DMA_PATTERN_LENGTH length ,
13810  uint8_t ignorePattern ) ;
13811 //******************************************************************************
13812 /* Function:
13813  void SYS_DMA_ChannelCRCSet
13814  (
13815  SYS_DMA_CHANNEL_HANDLE handle,
13816  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13817  )
13818  Summary:
13819  Sets up the CRC operation mode.
13820  Description:
13821  This function sets up the CRC computation features.
13822  Precondition:
13823  DMA should have been initialized by calling SYS_DMA_Initialize.
13824  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13825  The function SYS_DMA_ChannelSetup must be called to enable
13826  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13827  Parameters:
13828  handle - Handle of the DMA channel as returned by the
13829  SYS_DMA_ChannelAllocate function.
13830  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13831  crc.mode - Compute the CRC in Background/Append mode.
13832  crc.polyLength - Denotes the length of the polynomial.
13833  crc.bitOrder - CRC is calculated LSb/MSb first.
13834  crc.byteOrder - Byte selection order input pre-CRC Generator
13835  crc.writeOrder - Write byte order selection post-CRC computation
13836  crc.data - Computed/Seed CRC
13837  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13838  when mode is LFSR
13839  Returns:
13840  None.
13841  Example:
13842  <code>
13843  //Example 1
13844  // DMA calculation using the CRC background mode
13845  // 'handle' is a valid handle returned
13846  // by the SYS_DMA_ChannelAllocate function.
13847  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13848  crc.type = DMA_CRC_LFSR;
13849  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13850  crc.polyLength = 16;
13851  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13852  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13853  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13854  crc.data = 0xFFFF;
13855  crc.xorBitMask = 0x1021;
13856  SYS_DMA_ChannelCRCSet(handle, crc);
13857  </code>
13858  Remarks:
13859  This feature may not be available on all devices. Refer to the specific device
13860  data sheet to determine availability.
13861 */
13862 
13863 void
13865  SYS_DMA_CHANNEL_HANDLE handle ,
13867 //******************************************************************************
13868 /* Function:
13869  uint32_t SYS_DMA_ChannelCRCGet(void)
13870  Summary:
13871  Returns the computed CRC.
13872  Description:
13873  This function returns the computed CRC
13874  Precondition:
13875  DMA should have been initialized by calling SYS_DMA_Initialize.
13876  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13877  The function SYS_DMA_ChannelSetup must be called to enable
13878  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13879  The CRC generator must have been previously setup using
13880  SYS_DMA_ChannelCRCSet.
13881  Parameters:
13882  None
13883  Returns:
13884  uint32_t - The Computed CRC.
13885  Example:
13886  <code>
13887  uint32_t computedCRC;
13888  computedCRC = SYS_DMA_ChannelCRCGet();
13889  </code>
13890  Remarks:
13891  To get the computed CRC value this function must be called after the block
13892  transfer completion event (i.e., after getting and processing the callback
13893  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13894  This feature may not be available on all devices. Refer to the specific device
13895  data sheet to determine availability.
13896 */
13897 
13898 uint32_t
13899  SYS_DMA_ChannelCRCGet ( void ) ;
13900 //******************************************************************************
13901 /* Function:
13902  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13903  Summary:
13904  Enables a channel.
13905  Description:
13906  This function enables a channel.
13907  Precondition:
13908  DMA should have been initialized by calling SYS_DMA_Initialize.
13909  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13910  The function SYS_DMA_ChannelSetup must have been called to setup and
13911  enable the required features.
13912  Parameters:
13913  handle - Handle of the DMA channel as returned by the
13914  SYS_DMA_ChannelAllocate function.
13915  Returns:
13916  None.
13917  Example:
13918  <code>
13919  // 'handle' is a valid handle returned
13920  // by the SYS_DMA_ChannelAllocate function.
13921  SYS_DMA_ChannelEnable(handle);
13922  </code>
13923  Remarks:
13924  This function may not required to be called when starting DMA setup
13925  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13926  But may be needed to be called in the registered callback to enable the
13927  channel and continue the data transfer with the existing transfer parameters
13928  previously set with 'SYS_DMA_ChannelTransferAdd'.
13929  The DMA channel is by default disabled on the completion of block
13930  transfer(callback generated)
13931 */
13932 
13933 void
13935  SYS_DMA_CHANNEL_HANDLE handle ) ;
13936 //******************************************************************************
13937 /* Function:
13938  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13939  Summary:
13940  Disables a channel.
13941  Description:
13942  This function disables a channel.
13943  Precondition:
13944  DMA should have been initialized by calling SYS_DMA_Initialize.
13945  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13946  The function SYS_DMA_ChannelSetup must have been called to setup and
13947  enable the required features.
13948  A DMA channel should have been enabled either by calling
13949  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13950  Parameters:
13951  handle - Handle of the DMA channel as returned by the
13952  SYS_DMA_ChannelAllocate function.
13953  Returns:
13954  None.
13955  Example:
13956  <code>
13957  // 'handle' is a valid handle returned
13958  // by the SYS_DMA_ChannelAllocate function.
13959  SYS_DMA_ChannelDisable(handle);
13960  </code>
13961  Remarks:
13962  None.
13963 */
13964 
13965 void
13967  SYS_DMA_CHANNEL_HANDLE handle ) ;
13968 //******************************************************************************
13969 /* Function:
13970  void SYS_DMA_ChannelTransferAdd
13971  (
13972  SYS_DMA_CHANNEL_HANDLE handle,
13973  const void *srcAddr, size_t srcSize
13974  const void *destAddr, size_t destSize,
13975  size_t cellSize
13976  )
13977  Summary:
13978  Adds a data transfer to a DMA channel and Enables the channel to start
13979  data transfer.
13980  Description:
13981  This function adds a data transfer characteristics for a DMA channel. The
13982  The source and the destination addresses, source and destination lengths,
13983  The number of bytes transferred per cell event are set. It also enables
13984  the channel to start data transfer.
13985  If the requesting client registered an event callback with the service,
13986  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13987  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13988  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13989  processed successfully.
13990  Precondition:
13991  DMA should have been initialized by calling SYS_DMA_Initialize.
13992  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13993  The function SYS_DMA_ChannelSetup must have been called to setup and
13994  enable the required features.
13995  Parameters:
13996  handle - Handle of the DMA channel as returned by the
13997  SYS_DMA_ChannelAllocate function.
13998  srcAddr - Source of the DMA transfer
13999  srcSize - Size of the source
14000  destAddr - Destination of the DMA transfer
14001  destSize - Size of the destination
14002  cellSize - Size of the cell
14003  Returns:
14004  None.
14005  Example:
14006  <code>
14007  // Add 10 bytes of data transfer to UART TX
14008  // 'handle' is a valid handle returned
14009  // by the SYS_DMA_ChannelAllocate function.
14010  MY_APP_OBJ myAppObj;
14011  uint8_t buf[10];
14012  void *srcAddr;
14013  void *destAddr;
14014  size_t srcSize;
14015  size_t destSize;
14016  size_t cellSize;
14017  srcAddr = (uint8_t *) buf;
14018  srcSize = 10;
14019  destAddr = (uin8_t*) &U2TXREG;
14020  destSize = 1;
14021  cellSize = 1;
14022  // User registers an event handler with system service. This is done once
14023  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14024  (uintptr_t)&myAppObj);
14025  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14026  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14027  {
14028  // Error handling here
14029  }
14030  // Event Processing Technique. Event is received when
14031  // the transfer is processed.
14032  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14033  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14034  {
14035  switch(event)
14036  {
14037  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14038  // This means the data was transferred.
14039  break;
14040  case SYS_DMA_TRANSFER_EVENT_ERROR:
14041  // Error handling here.
14042  break;
14043  default:
14044  break;
14045  }
14046  }
14047  </code>
14048  Remarks:
14049  For PIC32MZ series of devices, if the source/destination addresses are
14050  RAM memory addresses, the the source/destination buffers
14051  should be made coherent to avoid the cache coherency issues.
14052  For example:
14053  <code>
14054  uint8_t buffer[1024];
14055  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14056  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14057  </code>
14058 */
14059 
14060 void
14062  SYS_DMA_CHANNEL_HANDLE handle ,
14063  const void * srcAddr ,
14064  size_t srcSize ,
14065  const void * destAddr ,
14066  size_t destSize ,
14067  size_t cellSize ) ;
14068 //******************************************************************************
14069 /* Function:
14070  void SYS_DMA_ChannelTransferSet
14071  (
14072  SYS_DMA_CHANNEL_HANDLE handle,
14073  const void *srcAddr, size_t srcSize
14074  const void *destAddr, size_t destSize,
14075  size_t cellSize
14076  )
14077  Summary:
14078  Sets up a data transfer to a DMA channel.
14079  Description:
14080  This function sets up data transfer characteristics for a DMA channel. The
14081  The source and the destination addresses, source and destination lengths,
14082  The number of bytes transferred per cell event are set.
14083  This function does not enables the DMA channel. The channel has to be explicitly
14084  enabled to start the data transfer.
14085  The above functions could be used in situations where in the user intends to
14086  setup transfer parameters but do not intend to enable the channel immediately.
14087  For example to chain to DMA channels in a cyclic order where the channels remains
14088  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14089  condition occurs.
14090  Precondition:
14091  DMA should have been initialized by calling SYS_DMA_Initialize.
14092  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14093  The function SYS_DMA_ChannelSetup must have been called to setup and
14094  enable the required features.
14095  Parameters:
14096  handle - Handle of the DMA channel as returned by the
14097  SYS_DMA_ChannelAllocate function.
14098  srcAddr - Source of the DMA transfer
14099  srcSize - Size of the source
14100  destAddr - Destination of the DMA transfer
14101  destSize - Size of the destination
14102  cellSize - Size of the cell
14103  Returns:
14104  None.
14105  Example:
14106  <code>
14107  // Set up 10 bytes of data transfer to UART TX
14108  // 'handle' is a valid handle returned
14109  // by the SYS_DMA_ChannelAllocate function.
14110  MY_APP_OBJ myAppObj;
14111  uint8_t buf[10];
14112  void *srcAddr;
14113  void *destAddr;
14114  size_t srcSize;
14115  size_t destSize;
14116  size_t cellSize;
14117  srcAddr = (uint8_t *) buf;
14118  srcSize = 10;
14119  destAddr = (uin8_t*) &U2TXREG;
14120  destSize = 1;
14121  cellSize = 1;
14122  // User registers an event handler with system service. This is done once
14123  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14124  (uintptr_t)&myAppObj);
14125  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14126  SYS_DMA_ChannelEnable(handle);
14127  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14128  {
14129  // Error handling here
14130  }
14131  // Event Processing Technique. Event is received when
14132  // the transfer is processed.
14133  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14134  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14135  {
14136  switch(event)
14137  {
14138  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14139  // This means the data was transferred.
14140  break;
14141  case SYS_DMA_TRANSFER_EVENT_ERROR:
14142  // Error handling here.
14143  break;
14144  default:
14145  break;
14146  }
14147  }
14148  </code>
14149  Remarks:
14150  For PIC32MZ series of devices, if the source/destination addresses are
14151  RAM memory addresses, the the source/destination buffers
14152  should be made coherent to avoid the cache coherency issues.
14153  For example:
14154  <code>
14155  uint8_t buffer[1024];
14156  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14157  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14158  </code>
14159 */
14160 
14161 void
14163  SYS_DMA_CHANNEL_HANDLE handle ,
14164  const void * srcAddr ,
14165  size_t srcSize ,
14166  const void * destAddr ,
14167  size_t destSize ,
14168  size_t cellSize ) ;
14169 //******************************************************************************
14170 /* Function:
14171  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14172  Summary:
14173  Returns the number of bytes transferred from source.
14174  Description:
14175  When a data transfer request is submitted. At any time while the transmission
14176  is in progress the size of the amount of data transferred from source
14177  can be known by calling this function.
14178  Precondition:
14179  DMA should have been initialized by calling SYS_DMA_Initialize.
14180  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14181  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14182  SYS_DMA_ChannelTransferSet.
14183  Parameters:
14184  handle - A valid channel handle, returned from the system service's
14185  Allocate routine
14186  Returns:
14187  size_t - Returns the number of bytes transferred from the submitted size.
14188  Example:
14189  <code>
14190  // 'handle' is a valid handle returned
14191  // by the SYS_DMA_ChannelAllocate function.
14192  MY_APP_OBJ myAppObj;
14193  uint8_t buf[10];
14194  void *srcAddr;
14195  void *destAddr;
14196  size_t srcSize;
14197  size_t destSize;
14198  size_t cellSize;
14199  size_t transferredSize;
14200  srcAddr = (uint8_t *) buf;
14201  srcSize = 10;
14202  destAddr = (uin8_t*) &U2TXREG;
14203  destSize = 1;
14204  cellSize = 1;
14205  channelHandle = SYS_DMA_ChannelAllocate(channel);
14206  // User registers an event handler with system service. This is done once
14207  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14208  (uintptr_t)&myAppObj);
14209  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14210  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14211  {
14212  // Error handling here
14213  }
14214  // The data is being transferred after adding the transfer to the DMA channel.
14215  // The user can get to know dynamically the amount of data
14216  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14217  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14218  </code>
14219  Remarks:
14220  None.
14221 */
14222 
14223 size_t
14225  SYS_DMA_CHANNEL_HANDLE handle ) ;
14226 //******************************************************************************
14227 /* Function:
14228  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14229  Summary:
14230  Returns the number of bytes transferred to destination.
14231  Description:
14232  When a data transfer request is submitted. At any time while the transmission
14233  is in progress the size of the amount of data transferred to destination
14234  can be known by calling this function.
14235  Precondition:
14236  DMA should have been initialized by calling SYS_DMA_Initialize.
14237  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14238  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14239  SYS_DMA_ChannelTransferSet.
14240  Parameters:
14241  handle - A valid channel handle, returned from the system service's
14242  Allocate routine
14243  Returns:
14244  size_t - Returns the number of bytes received from the submitted size.
14245  Example:
14246  <code>
14247  // 'handle' is a valid handle returned
14248  // by the SYS_DMA_ChannelAllocate function.
14249  MY_APP_OBJ myAppObj;
14250  uint8_t buf[10];
14251  void *srcAddr;
14252  void *destAddr;
14253  size_t srcSize;
14254  size_t destSize;
14255  size_t cellSize;
14256  size_t transferredSize;
14257  srcAddr = (uin8_t*) &U2RXREG;
14258  srcSize = 1;
14259  destAddr = (uint8_t *) buf ;
14260  destSize = 10;
14261  cellSize = 1;
14262  channelHandle = SYS_DMA_ChannelAllocate(channel);
14263  // User registers an event handler with system service. This is done once
14264  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14265  (uintptr_t)&myAppObj);
14266  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14267  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14268  {
14269  // Error handling here
14270  }
14271  // The data is being transferred after adding the transfer to the DMA channel.
14272  // The user can get to know dynamically the amount of data
14273  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14274  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14275  </code>
14276  Remarks:
14277  None.
14278 */
14279 
14280 size_t
14282  SYS_DMA_CHANNEL_HANDLE handle ) ;
14283 //******************************************************************************
14284 /*
14285  Function:
14286  void SYS_DMA_ChannelTransferEventHandlerSet
14287  (
14288  SYS_DMA_CHANNEL_HANDLE handle,
14289  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14290  const uintptr_t contextHandle
14291  )
14292  Summary:
14293  This function allows a DMA system service client to set an event handler.
14294  Description:
14295  This function allows a client to set an event handler. The client may want
14296  to receive transfer related events in cases when it uses non-blocking read and
14297  write functions. The event handler should be set before the client
14298  intends to perform operations that could generate events.
14299  This function accepts a contextHandle parameter. This parameter could be
14300  set by the client to contain (or point to) any client specific data object
14301  that should be associated with this DMA channel.
14302  Precondition:
14303  DMA should have been initialized by calling SYS_DMA_Initialize.
14304  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14305  Parameters:
14306  handle - A valid channel handle, returned from the system service's
14307  Allocate routine
14308  eventHandler - Pointer to the event handler function.
14309  contextHandle - Value identifying the context of the application/driver/middleware
14310  that registered the event handling function.
14311  Returns:
14312  None.
14313  Example:
14314  <code>
14315  // 'handle' is a valid handle returned
14316  // by the SYS_DMA_ChannelAllocate function.
14317  MY_APP_OBJ myAppObj;
14318  uint8_t buf[10];
14319  void *srcAddr;
14320  void *destAddr;
14321  size_t srcSize;
14322  size_t destSize;
14323  size_t cellSize;
14324  srcAddr = (uint8_t *) buf;
14325  srcSize = 10;
14326  destAddr = (uin8_t*) &U2TXREG;
14327  destSize = 1;
14328  cellSize = 1;
14329  channelHandle = SYS_DMA_ChannelAllocate(channel);
14330  // User registers an event handler with system service. This is done once
14331  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14332  (uintptr_t)&myAppObj);
14333  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14334  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14335  {
14336  // Error handling here
14337  }
14338  // Event Processing Technique. Event is received when
14339  // the transfer is processed.
14340  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14341  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14342  {
14343  switch(event)
14344  {
14345  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14346  // This means the data was transferred.
14347  break;
14348  case SYS_DMA_TRANSFER_EVENT_ERROR:
14349  // Error handling here.
14350  break;
14351  default:
14352  break;
14353  }
14354  }
14355  </code>
14356  Remarks:
14357  None.
14358  */
14359 
14360 void
14362  SYS_DMA_CHANNEL_HANDLE handle ,
14363  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14364  const uintptr_t contextHandle ) ;
14365 // *****************************************************************************
14366 /* Function:
14367  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14368  Summary:
14369  This function returns the error(if any) associated with the last client
14370  request.
14371  Description:
14372  This function returns the error(if any) associated with the last client
14373  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14374  the client can call this function to know the error cause.
14375  The error status will be updated on every operation and should be read
14376  frequently (ideally immediately after the service operation has completed)
14377  to know the relevant error status.
14378  Precondition:
14379  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14380  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14381  handle.
14382  Parameters:
14383  handle - Handle of the DMA channel as returned by the
14384  SYS_DMA_ChannelAllocate function.
14385  Returns:
14386  A SYS_DMA_ERROR type indicating last known error status.
14387  Example:
14388  <code>
14389  // 'handle' is a valid handle returned
14390  // by the SYS_DMA_ChannelAllocate function.
14391  // pDmaSrc, pDmaDst is the source,destination address
14392  // txferSrcSize, txferDesSize is the source,destination transfer size
14393  // cellSize is the cell size
14394  MY_APP_OBJ myAppObj;
14395  // Client registers an event handler with service. This is done once
14396  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14397  (uintptr_t)&myAppObj );
14398  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14399  DMA_TRIGGER_SOURCE_NONE);
14400  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14401  pDmaDst,txferDesSize,cellSize);
14402  SYS_DMA_ChannelForceStart(handle);
14403  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14404  {
14405  // Error handling here
14406  }
14407  // Event Processing Technique. Event is received when
14408  // the transfer is processed.
14409  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14410  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14411  {
14412  switch(event)
14413  {
14414  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14415  // This means the data was transferred.
14416  break;
14417  case SYS_DMA_TRANSFER_EVENT_ERROR:
14418  // Error handling here.
14419  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14420  {
14421  // There was an address error.
14422  // Do error handling here.
14423  }
14424  break;
14425  default:
14426  break;
14427  }
14428  }
14429  </code>
14430  Remarks:
14431  It is the client's responsibility to make sure that the error status is
14432  obtained frequently. The service will update the error status
14433  regardless of whether this has been examined by the client.
14434 */
14435 
14438  SYS_DMA_CHANNEL_HANDLE handle ) ;
14439 //******************************************************************************
14440 /* Function:
14441  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14442  Summary:
14443  Force start of transfer on the selected channel.
14444  Description:
14445  The function force start a DMA transfer to occur for the selected channel.
14446  Precondition:
14447  DMA should have been initialized by calling SYS_DMA_Initialize.
14448  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14449  The function SYS_DMA_ChannelSetup must have been called to setup and
14450  enable the required features.
14451  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14452  Parameters:
14453  handle - Handle of the DMA channel as returned by the
14454  SYS_DMA_ChannelAllocate function.
14455  Returns:
14456  None.
14457  Example:
14458  <code>
14459  // 'handle' is a valid handle returned
14460  // by the SYS_DMA_ChannelAllocate function.
14461  // pDmaSrc, pDmaDst is the source,destination address
14462  // txferSrcSize, txferDesSize is the source,destination transfer size
14463  // cellSize is the cell size
14464  MY_APP_OBJ myAppObj;
14465  // Client registers an event handler with service. This is done once
14466  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14467  (uintptr_t)&myAppObj );
14468  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14469  DMA_TRIGGER_SOURCE_NONE);
14470  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14471  pDmaDst,txferDesSize,cellSize);
14472  SYS_DMA_ChannelForceStart(handle);
14473  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14474  {
14475  // Error handling here
14476  }
14477  // Event Processing Technique. Event is received when
14478  // the transfer is processed.
14479  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14480  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14481  {
14482  switch(event)
14483  {
14484  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14485  // This means the data was transferred.
14486  break;
14487  case SYS_DMA_TRANSFER_EVENT_ERROR:
14488  // Error handling here.
14489  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14490  {
14491  // There was an address error.
14492  // Do error handling here.
14493  }
14494  break;
14495  default:
14496  break;
14497  }
14498  }
14499  </code>
14500  Remarks:
14501  This function must be used to start the DMA transfer when the channel has been
14502  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14503 */
14504 
14505 void
14507  SYS_DMA_CHANNEL_HANDLE handle ) ;
14508 //******************************************************************************
14509 /* Function:
14510  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14511  Summary:
14512  Force abort of transfer on the selected channel.
14513  Description:
14514  The function aborts a DMA transfer to occur for the selected channel.
14515  Precondition:
14516  DMA should have been initialized by calling SYS_DMA_Initialize.
14517  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14518  The function SYS_DMA_ChannelSetup must have been called to setup and
14519  enable the required features.
14520  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14521  Parameters:
14522  handle - Handle of the DMA channel as returned by the
14523  SYS_DMA_ChannelAllocate function.
14524  Returns:
14525  None.
14526  Example:
14527  <code>
14528  // 'handle' is a valid handle returned
14529  // by the SYS_DMA_ChannelAllocate function.
14530  // pDmaSrc, pDmaDst is the source,destination address
14531  // txferSrcSize, txferDesSize is the source,destination transfer size
14532  // cellSize is the cell size
14533  MY_APP_OBJ myAppObj;
14534  // Client registers an event handler with service. This is done once
14535  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14536  (uintptr_t)&myAppObj );
14537  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14538  DMA_TRIGGER_SOURCE_NONE);
14539  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14540  pDmaDst,txferDesSize,cellSize);
14541  SYS_DMA_ChannelForceStart(handle);
14542  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14543  {
14544  // Error handling here
14545  }
14546  ....
14547  ....
14548  // Client may need to abort a transfer
14549  SYS_DMA_ChannelForceAbort(handle);
14550  // Event Processing Technique. Event is received when
14551  // the transfer is processed.
14552  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14553  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14554  {
14555  switch(event)
14556  {
14557  case SYS_DMA_TRANSFER_EVENT_ABORT:
14558  // This means the data was transferred.
14559  break;
14560  case SYS_DMA_TRANSFER_EVENT_ERROR:
14561  // Error handling here.
14562  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14563  {
14564  // There was an address error.
14565  // Do error handling here.
14566  }
14567  break;
14568  default:
14569  break;
14570  }
14571  }
14572  </code>
14573  Remarks:
14574  This function must be used to abort the DMA transfer when the channel has been
14575  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14576  and SYS_DMA_ChannelAbortEventSet has not been called.
14577 */
14578 
14579 void
14581  SYS_DMA_CHANNEL_HANDLE handle ) ;
14582 //******************************************************************************
14583 /* Function:
14584  void SYS_DMA_ChannelAbortEventSet
14585  (
14586  SYS_DMA_CHANNEL_HANDLE handle,
14587  DMA_TRIGGER_SOURCE eventSrc
14588  )
14589  Summary:
14590  Sets an event source and enables cell transfer abort event for the same
14591  for the selected channel.
14592  Description:
14593  This functions enables a cell transfer abort event for the selected source
14594  event.
14595  Precondition:
14596  DMA should have been initialized by calling SYS_DMA_Initialize.
14597  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14598  The function SYS_DMA_ChannelSetup must have been called to setup and
14599  enable the required features.
14600  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14601  Parameters:
14602  handle - Handle of the DMA channel as returned by the
14603  SYS_DMA_ChannelAllocate function.
14604  eventSrc - The event causing the cell transfer abort
14605  Returns:
14606  None.
14607  Example:
14608  <code>
14609  // 'handle' is a valid handle returned
14610  // by the SYS_DMA_ChannelAllocate function.
14611  // pDmaSrc, pDmaDst is the source,destination address
14612  // txferSrcSize, txferDesSize is the source,destination transfer size
14613  // cellSize is the cell size
14614  MY_APP_OBJ myAppObj;
14615  // Client registers an event handler with service. This is done once
14616  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14617  (uintptr_t)&myAppObj );
14618  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14619  DMA_TRIGGER_SOURCE_NONE);
14620  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14621  pDmaDst,txferDesSize,cellSize);
14622  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14623  SYS_DMA_ChannelForceStart(handle);
14624  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14625  {
14626  // Error handling here
14627  }
14628  // Event Processing Technique. Event is received when
14629  // the transfer is processed.
14630  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14631  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14632  {
14633  switch(event)
14634  {
14635  case SYS_DMA_TRANSFER_EVENT_ABORT:
14636  // This means the data was transferred.
14637  break;
14638  case SYS_DMA_TRANSFER_EVENT_ERROR:
14639  // Error handling here.
14640  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14641  {
14642  // There was an address error.
14643  // Do error handling here.
14644  }
14645  break;
14646  default:
14647  break;
14648  }
14649  }
14650  </code>
14651  Remarks:
14652  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14653  current DMA transfer will be aborted. The behavior is a same as calling
14654  SYS_DMA_ChannelForceAbort.
14655 */
14656 
14657 void
14659  SYS_DMA_CHANNEL_HANDLE handle ,
14660  DMA_TRIGGER_SOURCE eventSrc ) ;
14661 //******************************************************************************
14662 /* Function:
14663  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14664  Summary:
14665  Returns the busy status of the specified DMA channel.
14666  Description:
14667  This function returns the busy status of the selected DMA channel
14668  Precondition:
14669  DMA should have been initialized by calling SYS_DMA_Initialize.
14670  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14671  Parameters:
14672  handle - Handle of the DMA channel as returned by the
14673  SYS_DMA_ChannelAllocate function.
14674  Returns:
14675  bool - true, if the selected DMA channel is active or enabled
14676  - false, if the selected DMA channel is inactive or disabled
14677  Example:
14678  <code>
14679  bool busyStat;
14680  busyStat = SYS_DMA_ChannelGetBusy(handle);
14681  </code>
14682  Remarks:
14683  This feature may not be available on all devices. Refer to the specific device
14684  data sheet to determine availability.
14685 */
14686 
14687 bool
14689  SYS_DMA_CHANNEL_HANDLE handle ) ;
14690 //******************************************************************************
14691 /* Function:
14692  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14693  Summary:
14694  Suspend DMA operation on the specified DMA channel.
14695  Description:
14696  This function suspends the DMA operation on the DMA channel
14697  specified by the channel handle.
14698  Precondition:
14699  DMA should have been initialized by calling SYS_DMA_Initialize.
14700  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14701  Parameters:
14702  handle - Handle of the DMA channel as returned by the
14703  SYS_DMA_ChannelAllocate function.
14704  Returns:
14705  None.
14706  Example:
14707  <code>
14708  SYS_DMA_ChannelSuspend(handle);
14709  </code>
14710  Remarks:
14711  This feature may not be available on all devices. Refer to the specific device
14712  data sheet to determine availability.
14713 */
14714 
14715 void
14717  SYS_DMA_CHANNEL_HANDLE handle ) ;
14718 //******************************************************************************
14719 /* Function:
14720  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14721  Summary:
14722  Resume DMA operation on the specified DMA channel.
14723  Description:
14724  This function resumes the DMA operation on the DMA channel
14725  specified by the channel handle.
14726  Precondition:
14727  DMA should have been initialized by calling SYS_DMA_Initialize.
14728  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14729  Parameters:
14730  handle - Handle of the DMA channel as returned by the
14731  SYS_DMA_ChannelAllocate function.
14732  Returns:
14733  None.
14734  Example:
14735  <code>
14736  SYS_DMA_ChannelResume(handle);
14737  </code>
14738  Remarks:
14739  This feature may not be available on all devices. Refer to the specific device
14740  data sheet to determine availability.
14741 */
14742 
14743 void
14745  SYS_DMA_CHANNEL_HANDLE handle ) ;
14746 // *****************************************************************************
14747 // *****************************************************************************
14748 // Section: Global DMA Management Functions
14749 // *****************************************************************************
14750 // *****************************************************************************
14751 //******************************************************************************
14752 /* Function:
14753  void SYS_DMA_Suspend(void)
14754  Summary:
14755  Suspend DMA transfers.
14756  Description:
14757  This function suspends DMA transfers to allow CPU uninterrupted access
14758  to data bus
14759  Precondition:
14760  DMA should have been initialized by calling SYS_DMA_Initialize.
14761  Parameters:
14762  None.
14763  Returns:
14764  None.
14765  Example:
14766  <code>
14767  SYS_DMA_Suspend();
14768  </code>
14769  Remarks:
14770  None
14771 */
14772 
14773 void
14774  SYS_DMA_Suspend ( void ) ;
14775 //******************************************************************************
14776 /* Function:
14777  void SYS_DMA_Resume(void)
14778  Summary:
14779  Resume DMA operations.
14780  Description:
14781  This function disables DMA suspend. It resumes the DMA operation suspended
14782  by calling SYS_DMA_Suspend. The DMA operates normally.
14783  Precondition:
14784  DMA should have been initialized by calling SYS_DMA_Initialize.
14785  Parameters:
14786  None.
14787  Returns:
14788  None.
14789  Example:
14790  <code>
14791  SYS_DMA_Resume();
14792  </code>
14793  Remarks:
14794  None
14795 */
14796 
14797 void
14798  SYS_DMA_Resume ( void ) ;
14799 //******************************************************************************
14800 /* Function:
14801  bool SYS_DMA_IsBusy(void)
14802  Summary:
14803  Returns the busy status of the DMA module.
14804  Description:
14805  This function returns the busy status of the DMA module
14806  Precondition:
14807  DMA should have been initialized by calling SYS_DMA_Initialize.
14808  Parameters:
14809  None.
14810  Returns:
14811  Boolean
14812  - true - The DMA module is active
14813  - false - The DMA module is inactive and disabled
14814  <code>
14815  bool busyStat;
14816  busyStat = SYS_DMA_IsBusy();
14817  </code>
14818  Remarks:
14819  This feature may not be available on all devices. Refer to the specific device
14820  data sheet to determine availability.
14821 */
14822 
14823 bool
14824  SYS_DMA_IsBusy ( void ) ;
14825 // *****************************************************************************
14826 // *****************************************************************************
14827 // Section: Deprecated functions
14828 // *****************************************************************************
14829 // *****************************************************************************
14830 //*******************************************************************************
14831 /* Function:
14832  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14833  Summary:
14834  This function is deprecated. Use SYS_DMA_Tasks function.
14835  */
14836 
14837 void
14838  SYS_DMA_Tasks (
14839  SYS_MODULE_OBJ object ,
14840  DMA_CHANNEL activeChannel ) ;
14841 //*****************************************************************************
14842 /* Function:
14843  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14844  Summary:
14845  This function is deprecated. Use SYS_DMA_Tasks function.
14846  */
14847 
14848 void
14850  SYS_MODULE_OBJ object ) ;
14851 //*******************************************************************************
14852 /* Function:
14853  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14854  Summary:
14855  This function is deprecated. Use SYS_DMA_Tasks function.
14856  */
14857 
14858 void
14860  SYS_MODULE_OBJ object ,
14861  DMA_CHANNEL activeChannel ) ;
14862  // #ifndef _SYS_DMA_H
14863 /*******************************************************************************
14864  End of File
14865 */
14866 
14867 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14868 /* CLOSE_FILE Include File */
14869 
14870 // DOM-IGNORE-BEGIN
14871 // DOM-IGNORE-END
14872 // *****************************************************************************
14873 // *****************************************************************************
14874 // Section: Data Types
14875 // *****************************************************************************
14876 // *****************************************************************************
14877 // *****************************************************************************
14878 /* Driver USART Module Index
14879  Summary:
14880  USART driver index definitions
14881  Description:
14882  These constants provide USART driver index definitions.
14883  Remarks:
14884  These constants should be used in place of hard-coded numeric literals.
14885  These values should be passed into the DRV_USART_Initialize and
14886  DRV_USART_Open routines to identify the driver instance in use.
14887 */
14888 #define DRV_USART_INDEX_0 0
14889 #define DRV_USART_INDEX_1 1
14890 #define DRV_USART_INDEX_2 2
14891 #define DRV_USART_INDEX_3 3
14892 #define DRV_USART_INDEX_4 4
14893 #define DRV_USART_INDEX_5 5
14894 // *****************************************************************************
14895 /* USART Driver Module Count
14896  Summary:
14897  Number of valid USART drivers
14898  Description:
14899  This constant identifies the maximum number of USART Driver instances that
14900  should be defined in the system. Defining more instances than this
14901  constant will waste RAM memory space.
14902  This constant can also be used by the system and application to identify the
14903  number of USART instances on this microcontroller.
14904  Remarks:
14905  This value is part-specific.
14906 */
14907 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14908 // *****************************************************************************
14909 /* USART Driver Write Error
14910  Summary:
14911  USART Driver Write Error.
14912  Description:
14913  This constant is returned by DRV_USART_Write() function when an error
14914  occurs.
14915  Remarks:
14916  None.
14917 */
14918 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14919 // *****************************************************************************
14920 /* USART Driver Read Error
14921  Summary:
14922  USART Driver Read Error.
14923  Description:
14924  This constant is returned by DRV_USART_Read() function when an error
14925  occurs.
14926  Remarks:
14927  None.
14928 */
14929 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14930 // *****************************************************************************
14931 /* USART Driver Buffer Handle
14932  Summary:
14933  Handle identifying a read or write buffer passed to the driver.
14934  Description:
14935  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14936  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14937  buffer passed into the function and it allows the application to track the
14938  completion of the data from (or into) that buffer. The buffer handle value
14939  returned from the "buffer add" function is returned back to the client
14940  by the "event handler callback" function registered with the driver.
14941  The buffer handle assigned to a client request expires when the client has
14942  been notified of the completion of the buffer transfer (after event handler
14943  function that notifies the client returns) or after the buffer has been
14944  retired by the driver if no event handler callback was set.
14945  Remarks:
14946  None
14947 */
14948 
14949 typedef
14950 uintptr_t
14952 // *****************************************************************************
14953 /* USART Driver Invalid Buffer Handle
14954  Summary:
14955  Definition of an invalid buffer handle.
14956  Description:
14957  This is the definition of an invalid buffer handle. An invalid buffer handle
14958  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14959  functions if the buffer add request was not successful.
14960  Remarks:
14961  None
14962 */
14963 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14964 // *****************************************************************************
14965 /* USART Modes of Operation
14966  Summary:
14967  Identifies the modes of the operation of the USART module
14968  Description:
14969  This data type identifies the modes of the operation of the USART module.
14970  Remarks:
14971  Not all modes are available on all devices. Refer to the specific device data
14972  sheet to determine availability.
14973 */
14974 
14975 typedef
14976  enum
14977  {
14978  /* USART works in IRDA mode */
14980  /* This is the normal point to point communication mode where the USART
14981  communicates directly with another USART by connecting it's Transmit signal
14982  to the external USART's Receiver signal and vice versa. An external
14983  transceiver may be connected to obtain RS-232 signal levels. This type of
14984  connection is typically full duplex. */
14986  /* This is a multi-point bus mode where the USART can communicate with
14987  many other USARTS on a bus using an address-based protocol such as RS-485.
14988  This mode is typically half duplex and the physical layer may require a
14989  transceiver. In this mode every USART on the bus is assigned an address and
14990  the number of data bits is 9 bits */
14992  /* Loopback mode internally connects the Transmit signal to the Receiver
14993  signal, looping data transmission back into this USART's own input. It is
14994  useful primarily as a test mode. */
14997 // *****************************************************************************
14998 /* USART Driver Buffer Events
14999  Summary
15000  Identifies the possible events that can result from a buffer add request.
15001  Description
15002  This enumeration identifies the possible events that can result from a
15003  buffer add request caused by the client calling either the
15004  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15005  Remarks:
15006  One of these values is passed in the "event" parameter of the event
15007  handling callback function that the client registered with the driver by
15008  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15009  transfer request is completed.
15010 */
15011 
15012 typedef
15013  enum
15014  {
15015  /* All data from or to the buffer was transferred successfully. */
15017  /* There was an error while processing the buffer transfer request. */
15019  /* Data transfer aborted (Applicable in DMA mode) */
15022 // *****************************************************************************
15023 /* USART Driver Buffer Result
15024  Summary
15025  Identifies the possible result of the buffer processing.
15026  Description
15027  This enumeration identifies the possible result of the buffer processing.
15028 
15029  Remarks:
15030  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15031  is in the free buffer pool.
15032 */
15033 
15034 typedef
15035  enum
15036  {
15037  /* Buffer handle is not valid*/
15039  /* Buffer handle has expired. */
15041  /* Buffer is removed from the queue succesfully*/
15043  /* Buffer removal failed because of unable to acquire the mutex
15044  * This is applicable in RTOS mode only */
15047 // *****************************************************************************
15048 /* USART Driver Buffer Event Handler Function Pointer
15049  Summary
15050  Pointer to a USART Driver Buffer Event handler function
15051  Description
15052  This data type defines the required function signature for the USART driver
15053  buffer event handling callback function. A client must register a pointer
15054  to a buffer event handling function whose function signature (parameter
15055  and return value types) match the types specified by this function pointer
15056  in order to receive buffer related event calls back from the driver.
15057  The parameters and return values and are described here and
15058  a partial example implementation is provided.
15059  Parameters:
15060  event - Identifies the type of event
15061  bufferHandle - Handle identifying the buffer to which the vent relates
15062  context - Value identifying the context of the application that registered
15063  the event handling function.
15064  Returns:
15065  None.
15066  Example:
15067  <code>
15068  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15069  DRV_USART_BUFFER_HANDLE bufferHandle,
15070  uintptr_t context )
15071  {
15072  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15073  switch(event)
15074  {
15075  case DRV_USART_BUFFER_EVENT_COMPLETE:
15076  // Handle the completed buffer.
15077  break;
15078  case DRV_USART_BUFFER_EVENT_ERROR:
15079  default:
15080  // Handle error.
15081  break;
15082  }
15083  }
15084  </code>
15085  Remarks:
15086  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15087  transferred successfully.
15088  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15089  transferred successfully. The DRV_USART_ErrorGet function can be called to
15090  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15091  called to find out how many bytes were processed.
15092  The bufferHandle parameter contains the buffer handle of the buffer that
15093  associated with the event.
15094  The context parameter contains the a handle to the client context,
15095  provided at the time the event handling function was registered using the
15096  DRV_USART_BufferEventHandlerSet function. This context handle value is
15097  passed back to the client as the "context" parameter. It can be any value
15098  necessary to identify the client context or instance (such as a pointer to
15099  the client's data) instance of the client that made the buffer add request.
15100  The event handler function executes in the driver peripheral's interrupt
15101  context when the driver is configured for interrupt mode operation. It is
15102  recommended of the application to not perform process intensive or blocking
15103  operations with in this function.
15104  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15105  be called in the event handler to add a buffer to the driver queue. These
15106  functions can only be called to add buffers to the driver whose event
15107  handler is running. For example, buffers cannot be added USART2 driver in
15108  USART1 driver event handler.
15109 */
15110 
15111 typedef
15113 DRV_USART_BUFFER_HANDLE bufferHandle ,
15114 uintptr_t context ) ;
15115 // *****************************************************************************
15116 /* USART Driver Byte Event Handler Function Pointer
15117  Summary
15118  Pointer to a USART Driver Byte Event handler function
15119  Description
15120  This data type defines the required function signature for the USART driver
15121  byte event handling callback function. A client must register a pointer to a
15122  byte event handling function whose function signature (parameter and return
15123  value types) match the types specified by this function pointer in order to
15124  receive byte related event calls back from the driver.
15125  Parameters:
15126  index - Identifier for the instance
15127  Returns:
15128  None.
15129  Example:
15130  <code>
15131  void APP_MyUsartTxEventHandler(void)
15132  {
15133  // Handle the transmit byte event
15134  }
15135  </code>
15136  Remarks:
15137  The event handler function executes in the driver peripheral's interrupt
15138  context when the driver is configured for interrupt mode operation. It is
15139  recommended that the application not perform process intensive or blocking
15140  operations with in this function.
15141 */
15142 
15143 typedef
15144 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15145 // *****************************************************************************
15146 /* USART Handshake Modes
15147  Summary:
15148  Identifies the handshaking modes supported by the USART driver.
15149  Description:
15150  This data type identifies the handshaking modes supported by the USART
15151  driver.
15152  Remarks:
15153  Not all modes are available on all devices. Refer to the specific device data
15154  sheet to determine availability.
15155 */
15156 
15157 typedef
15158  enum
15159  {
15160  /* Handshaking occurs in Flow Control Mode */
15161  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15162  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15163  ,
15164  /* Handshaking occurs in Simplex Mode */
15165  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15166  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15167  ,
15168  /* No Handshaking */
15169  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15170  2 /*DOM-IGNORE-END*/
15172 // *****************************************************************************
15173 /* USART Baud Set Result
15174  Summary:
15175  Identifies the results of the baud set function.
15176  Description:
15177  This data type identifies the results of the DRV_USART_BaudSet function.
15178  Remarks:
15179  None.
15180 */
15181 
15182 typedef
15183  enum
15184  {
15185  /* The driver was not able to change the baud */
15186  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15187  - 1 /*DOM-IGNORE-END*/
15188  ,
15189  /* The driver was able to change the baud successfully */
15192 // *****************************************************************************
15193 /* USART Line Control Set Result
15194  Summary:
15195  Identifies the results of the baud set function.
15196  Description:
15197  This data type identifies the results of the DRV_USART_LineControlSet
15198  function.
15199  Remarks:
15200  None.
15201 */
15202 
15203 typedef
15204  enum
15205  {
15206  /* The driver was not able to change the Line Control */
15207  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15208  - 1 /*DOM-IGNORE-END*/
15209  ,
15210  /* The driver was able to change the Line Control successfully */
15213 // *****************************************************************************
15214 /* USART Line Control Modes
15215  Summary:
15216  Identifies the line control modes supported by the USART driver.
15217  Description:
15218  This data type identifies the line control modes supported by the USART
15219  driver. Line control modes define the number of data bits, parity mode, and
15220  the number of stop bits in a USART transmit and receive frames.
15221  Remarks:
15222  The abbreviations used in the labels for the values of this enumeration
15223  follow the format <data><parity><stop>, where:
15224  <data> is the number of data bits
15225  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15226  added to obtain an even number of bits, or "ODD" for one bit
15227  added to obtain an odd number of bits.
15228  <stop> is the number of Stop bits
15229 */
15230 
15231 typedef
15232  enum
15233  {
15234  /* 8 data bits, no parity bit, 1 stop bit */
15235  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15236  USART_8N1 /* DOM-IGNORE-END*/
15237  ,
15238  /* 9 data bits, no parity bit, 1 stop bit */
15239  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15240  USART_9N1 /* DOM-IGNORE-END*/
15241  ,
15242  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15243  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15244  USART_8E1 /* DOM-IGNORE-END*/
15245  ,
15246  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15247  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15248  USART_8E2 /* DOM-IGNORE-END*/
15249  ,
15250  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15251  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15252  USART_8O1 /* DOM-IGNORE-END*/
15253  ,
15254  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15255  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15256  USART_8O2 /* DOM-IGNORE-END*/
15257  ,
15258  /* 8 data bits, no parity bit, 2 stop bit */
15259  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15260  USART_8N2 /* DOM-IGNORE-END*/
15261  ,
15262  /* 9 data bits, no parity bit, 2 stop bit */
15263  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15264  USART_9N2 /* DOM-IGNORE-END*/
15266 // *****************************************************************************
15267 /* USART Initialization flags
15268  Summary:
15269  Flags identifying features that can be enabled when the driver is
15270  initialized.
15271  Description:
15272  This enumeration defines flags identifying features that can be enabled
15273  when the driver is initialized.
15274  Remarks:
15275  These flags can be logically ORed together. They are passed into the
15276  DRV_USART_Initialize function through the "flags" member of the
15277  DRV_USART_INIT structure.
15278 */
15279 
15280 typedef
15281  enum
15282  {
15283  /* Use this if no flags need to be set */
15284  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15285  0 /*DOM-IGNORE-END*/
15286  ,
15287  /* Flag to enable "wake on start" operation. If supported and enabled,
15288  this feature will allow the USART to wake-up the device when a
15289  Start bit is received. This option should be selected only when the
15290  device is to placed in Sleep mode. Note that enabling this bit will
15291  also cause the first received character to be lost. Refer to the specific
15292  device data sheet for more information. */
15294  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15295  ,
15296  /* Flag to enable auto baud detection. If supported and enabled, this
15297  feature will allow the USART to automatically detect the baud rate in
15298  use. */
15299  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15300  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15301  ,
15302  /* Flag to enable stop in idle. If supported and enabled , this
15303  feature will allow the USART to stop when the CPU enters Idle
15304  mode */
15306  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15308 // *****************************************************************************
15309 /* Operation Mode Initialization Data
15310  Summary:
15311  Defines the initialization data required for different operation modes of
15312  USART.
15313  Description:
15314  This data type defines the initialization data required for different
15315  operation modes of the USART.
15316  Remarks:
15317  None
15318 */
15319 
15320 typedef
15321  union
15322  {
15323  /* Initialization for Addressed mode */
15324  struct
15325  {
15326  /* Address of the device. */
15327  uint8_t address ;
15328  } AddressedModeInit ;
15330 // *****************************************************************************
15331 /* USART Driver Errors.
15332  Summary:
15333  Defines the possible errors that can occur during driver operation.
15334  Description:
15335  This data type defines the possible errors that can occur when occur during
15336  USART driver operation. These values are returned by DRV_USART_ErrorGet
15337  function.
15338  Remarks:
15339  None
15340 */
15341 
15342 typedef
15343  enum
15344  {
15345  /* There was no error */
15347  /*DOM-IGNORE-BEGIN*/
15348  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15349  ,
15350  /* This indicates that a parity error has occurred */
15352  /*DOM-IGNORE-BEGIN*/
15353  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15354  ,
15355  /* This indicates that a framing error has occurred */
15357  /*DOM-IGNORE-BEGIN*/
15358  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15359  ,
15360  /* This indicates a receiver overflow has occurred */
15362  /*DOM-IGNORE-BEGIN*/
15363  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15364  ,
15365  /* Channel address error (Applicable in DMA mode) */
15366  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15367  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15368  } DRV_USART_ERROR ;
15369 // *****************************************************************************
15370 /* USART Client-Specific Driver Status
15371  Summary:
15372  Defines the client-specific status of the USART driver.
15373  Description:
15374  This enumeration defines the client-specific status codes of the USART
15375  driver.
15376  Remarks:
15377  Returned by the DRV_USART_ClientStatus function.
15378 */
15379 
15380 typedef
15381  enum
15382  {
15383  /* An error has occurred.*/
15385  /* The driver is closed, no operations for this client are ongoing,
15386  and/or the given handle is invalid. */
15388  /* The driver is currently busy and cannot start additional operations. */
15390  /* The module is running and ready for additional operations */
15393 // *****************************************************************************
15394 /* USART Driver Transfer Flags
15395  Summary
15396  Specifies the status of the receive or transmit
15397  Description
15398  This type specifies the status of the receive or transmit operation.
15399  Remarks:
15400  More than one of these values may be OR'd together to create a complete
15401  status value. To test a value of this type, the bit of interest must be
15402  ANDed with the value and checked to see if the result is non-zero.
15403 */
15404 
15405 typedef
15406  enum
15407  {
15408  /* Indicates that at least one byte of Data has been received */
15410  /*DOM-IGNORE-BEGIN*/
15411  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15412  ,
15413  /* Indicates that the core driver receiver buffer is empty */
15415  /*DOM-IGNORE-BEGIN*/
15416  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15417  ,
15418  /* Indicates that the core driver transmitter buffer is full */
15420  /*DOM-IGNORE-BEGIN*/
15421  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15422  ,
15423  /* Indicates that the core driver transmitter buffer is empty */
15425  /*DOM-IGNORE-BEGIN*/
15426  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15428 // *****************************************************************************
15429 /* USART Driver Initialization Data
15430  Summary:
15431  Defines the data required to initialize or reinitialize the USART driver
15432  Description:
15433  This data type defines the data required to initialize or reinitialize the
15434  USART driver. If the driver is built statically, the members of this data
15435  structure are statically over-ridden by static override definitions in the
15436  system_config.h file.
15437  Remarks:
15438  None.
15439 */
15440 
15441 typedef
15442  struct
15443  {
15444  /* System module initialization data */
15445  SYS_MODULE_INIT moduleInit ;
15446  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15447  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15448  system_config.h header file. */
15449  USART_MODULE_ID usartID ;
15450  /* Identifies the Operation mode of the USART driver. For a static build of
15451  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15452  system_config.h header file. */
15454  /* Data required by the operation mode of the driver. For a static build of
15455  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15456  system_config.h header file. */
15458  /* Flags to enable specific features. Refer to the
15459  description of DRV_USART_INIT_FLAGS for more details. For a static build
15460  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15461  system_config.h header file. */
15462  DRV_USART_INIT_FLAGS flags ;
15463  /* USART module Baud Rate Generator Clock. This typically
15464  the peripheral bus clock frequency. For a static build of the driver,
15465  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15466  header file. */
15467  uint32_t brgClock ;
15468  /* The initial USART line control settings. For a static build of the driver
15469  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15470  system_config.h header file. */
15471  DRV_USART_LINE_CONTROL lineControl ;
15472  /* Baud Rate value to be used, if not using auto baud. For a static build of
15473  the driver, this is overridden by the DRV_USART_BAUD macro in the
15474  system_config.h header file. */
15475  uint32_t baud ;
15476  /* Handshaking mode. For a static build of the driver, this is overridden by
15477  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15478  DRV_USART_HANDSHAKE handshake ;
15479  /* Lines enabled for the USART operation. For a static build of the driver,
15480  this is overridden by the DRV_USART_LINES_ENABLE macro in
15481  the system_config.h header file.
15482  For PPS parts, pin selection in ports overrides this. */
15483  USART_OPERATION_MODE linesEnable ;
15484  /* Interrupt source ID for the transmitter interrupt. For a static build of
15485  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15486  macro in the system_config.h header. */
15487  INT_SOURCE interruptTransmit ;
15488  /* Interrupt source ID for the receiver interrupt. For a static build of
15489  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15490  macro in the system_config.h header. */
15491  INT_SOURCE interruptReceive ;
15492  /* Interrupt source ID for the error Interrupt. For a static build of the
15493  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15494  in the system_config.h header. */
15495  INT_SOURCE interruptError ;
15496  /* This is the receive buffer queue size. This is the maximum
15497  number of read requests that driver will queue. For a
15498  static build of the driver, this is overridden by the
15499  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15500  unsigned int queueSizeReceive ;
15501  /* This is the transmit buffer queue size. This is the maximum
15502  number of write requests that driver will queue. For a
15503  static build of the driver, this is overridden by the
15504  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15505  unsigned int queueSizeTransmit ;
15506  /* This is the USART transmit DMA channel.
15507  For a static build of the driver, this is overridden by the
15508  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15509  DMA_CHANNEL dmaChannelTransmit ;
15510  /* This is the USART receive DMA channel.
15511  For a static build of the driver, this is overridden by the
15512  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15513  DMA_CHANNEL dmaChannelReceive ;
15514  /* This is the USART transmit DMA channel interrupt.
15515  For a static build of the driver, this is overridden by the
15516  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15517  INT_SOURCE dmaInterruptTransmit ;
15518  /* This is the USART receive DMA channel interrupt.
15519  For a static build of the driver, this is overridden by the
15520  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15521  INT_SOURCE dmaInterruptReceive ;
15522  } DRV_USART_INIT ;
15523 //DOM-IGNORE-BEGIN
15524 //DOM-IGNORE-END
15525  // #ifndef _DRV_USART_DEFINITIONS_H
15526 /*******************************************************************************
15527  End of File
15528 */
15529 
15530 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15531 /* CLOSE_FILE Include File */
15532 
15533 // DOM-IGNORE-BEGIN
15534 // DOM-IGNORE-END
15535 // *****************************************************************************
15536 // *****************************************************************************
15537 // Section: USART Driver Module Interface Routines
15538 // *****************************************************************************
15539 // *****************************************************************************
15540 // *****************************************************************************
15541 /* Function:
15542  SYS_MODULE_OBJ DRV_USART_Initialize
15543  (
15544  const SYS_MODULE_INDEX index,
15545  const SYS_MODULE_INIT * const init
15546  )
15547  Summary:
15548  Initializes the USART instance for the specified driver index.
15549  <p><b>Implementation:</b> Static/Dynamic</p>
15550  Description:
15551  This routine initializes the USART driver instance for the specified driver
15552  index, making it ready for clients to open and use it. The initialization
15553  data is specified by the init parameter. The initialization may fail if the
15554  number of driver objects allocated are insufficient or if the specified
15555  driver instance is already initialized. The driver instance index is
15556  independent of the USART module ID. For example, driver instance 0 can be
15557  assigned to USART2. If the driver is built statically, then some of the
15558  initialization parameters are overridden by configuration macros. Refer to
15559  the description of the DRV_USART_INIT data structure for more details on
15560  which members on this data structure are overridden.
15561  Precondition:
15562  None.
15563  Parameters:
15564  index - Identifier for the instance to be initialized
15565  init - Pointer to a data structure containing any data necessary to
15566  initialize the driver.
15567  Returns:
15568  If successful, returns a valid handle to a driver instance object.
15569  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15570  Example:
15571  <code>
15572  // The following code snippet shows an example USART driver initialization.
15573  // The driver is initialized for normal mode and a baud of 300. The
15574  // receive queue size is set to 2 and transmit queue size is set to 3.
15575  DRV_USART_INIT usartInit;
15576  SYS_MODULE_OBJ objectHandle;
15577  usartInit.baud = 300;
15578  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15579  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15580  usartInit.usartID = USART_ID_2;
15581  usartInit.brgClock = 80000000;
15582  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15583  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15584  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15585  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15586  usartInit.queueSizeReceive = 2;
15587  usartInit.queueSizeTransmit = 3;
15588  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15589  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15590  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15591  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15592  {
15593  // Handle error
15594  }
15595  </code>
15596  Remarks:
15597  This routine must be called before any other USART routine is called.
15598  This routine should only be called once during system initialization
15599  unless DRV_USART_Deinitialize is called to deinitialize the driver
15600  instance. This routine will NEVER block for hardware access.
15601 */
15602 
15603 SYS_MODULE_OBJ
15605  const SYS_MODULE_INDEX index ,
15606  const SYS_MODULE_INIT * const init ) ;
15607 // *****************************************************************************
15608 /* Function:
15609  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15610  Summary:
15611  Deinitializes the specified instance of the USART driver module.
15612  <p><b>Implementation:</b> Static/Dynamic</p>
15613  Description:
15614  Deinitializes the specified instance of the USART driver module, disabling
15615  its operation (and any hardware). Invalidates all the internal data.
15616  Precondition:
15617  Function DRV_USART_Initialize should have been called before calling this
15618  function.
15619  Parameters:
15620  object - Driver object handle, returned from the
15621  DRV_USART_Initialize routine
15622  Returns:
15623  None.
15624  Example:
15625  <code>
15626  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15627  SYS_STATUS status;
15628  DRV_USART_Deinitialize(object);
15629  status = DRV_USART_Status(object);
15630  if (SYS_MODULE_DEINITIALIZED != status)
15631  {
15632  // Check again later if you need to know
15633  // when the driver is deinitialized.
15634  }
15635  </code>
15636  Remarks:
15637  Once the Initialize operation has been called, the Deinitialize operation
15638  must be called before the Initialize operation can be called again. This
15639  routine will NEVER block waiting for hardware.
15640 */
15641 
15642 void
15644  SYS_MODULE_OBJ object ) ;
15645 // *****************************************************************************
15646 /* Function:
15647  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15648  Summary:
15649  Gets the current status of the USART driver module.
15650  <p><b>Implementation:</b> Static/Dynamic</p>
15651  Description:
15652  This routine provides the current status of the USART driver module.
15653  Precondition:
15654  Function DRV_USART_Initialize should have been called before calling this
15655  function.
15656  Parameters:
15657  object - Driver object handle, returned from the
15658  DRV_USART_Initialize routine
15659  Returns:
15660  SYS_STATUS_READY - Indicates that the driver is busy with a
15661  previous system level operation and cannot start
15662  another
15663  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15664  deinitialized
15665  Example:
15666  <code>
15667  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15668  SYS_STATUS usartStatus;
15669  usartStatus = DRV_USART _Status(object);
15670  if (SYS_STATUS_READY == usartStatus)
15671  {
15672  // This means the driver can be opened using the
15673  // DRV_USART_Open() function.
15674  }
15675  </code>
15676  Remarks:
15677  A driver can opened only when its status is SYS_STATUS_READY.
15678 */
15679 
15680 SYS_STATUS
15682  SYS_MODULE_OBJ object ) ;
15683 // *****************************************************************************
15684 /* Function:
15685  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15686  Summary:
15687  Maintains the driver's transmit state machine and implements its ISR.
15688  <p><b>Implementation:</b> Static/Dynamic</p>
15689  Description:
15690  This routine is used to maintain the driver's internal transmit state
15691  machine and implement its transmit ISR for interrupt-driven implementations.
15692  In polling mode, this function should be called from the SYS_Tasks
15693  function. In interrupt mode, this function should be called in the transmit
15694  interrupt service routine of the USART that is associated with this USART
15695  driver hardware instance.
15696  Precondition:
15697  The DRV_USART_Initialize routine must have been called for the specified
15698  USART driver instance.
15699  Parameters:
15700  object - Object handle for the specified driver instance (returned from
15701  DRV_USART_Initialize)
15702  Returns:
15703  None.
15704  Example:
15705  <code>
15706  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15707  while (true)
15708  {
15709  DRV_USART_TasksTransmit (object);
15710  // Do other tasks
15711  }
15712  </code>
15713  Remarks:
15714  This routine is normally not called directly by an application. It is
15715  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15716  ISR.
15717  This routine may execute in an ISR context and will never block or access any
15718  resources that may cause it to block.
15719 */
15720 
15721 void
15723  SYS_MODULE_OBJ object ) ;
15724 // *****************************************************************************
15725 /* Function:
15726  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15727  Summary:
15728  Maintains the driver's receive state machine and implements its ISR.
15729  <p><b>Implementation:</b> Static/Dynamic</p>
15730  Description:
15731  This routine is used to maintain the driver's internal receive state machine
15732  and implement its receive ISR for interrupt-driven implementations. In
15733  polling mode, this function should be called from the SYS_Tasks function.
15734  In interrupt mode, this function should be called in the receive interrupt
15735  service routine of the USART that is associated with this USART driver
15736  hardware instance.
15737  Precondition:
15738  The DRV_USART_Initialize routine must have been called for the specified
15739  USART driver instance.
15740  Parameters:
15741  object - Object handle for the specified driver instance (returned from
15742  DRV_USART_Initialize)
15743  Returns:
15744  None.
15745  Example:
15746  <code>
15747  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15748  while (true)
15749  {
15750  DRV_USART_TasksReceive (object);
15751  // Do other tasks
15752  }
15753  </code>
15754  Remarks:
15755  This routine is normally not called directly by an application. It is
15756  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15757  ISR.
15758  This routine may execute in an ISR context and will never block or access any
15759  resources that may cause it to block.
15760 */
15761 
15762 void
15764  SYS_MODULE_OBJ object ) ;
15765 // *****************************************************************************
15766 /* Function:
15767  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15768  Summary:
15769  Maintains the driver's error state machine and implements its ISR.
15770  <p><b>Implementation:</b> Static/Dynamic</p>
15771  Description:
15772  This routine is used to maintain the driver's internal error state machine
15773  and implement its error ISR for interrupt-driven implementations. In
15774  polling mode, this function should be called from the SYS_Tasks function.
15775  In interrupt mode, this function should be called in the error interrupt
15776  service routine of the USART that is associated with this USART driver
15777  hardware instance.
15778  Precondition:
15779  The DRV_USART_Initialize routine must have been called for the specified
15780  USART driver instance.
15781  Parameters:
15782  object - Object handle for the specified driver instance (returned from
15783  DRV_USART_Initialize)
15784  Returns:
15785  None.
15786  Example:
15787  <code>
15788  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15789  while (true)
15790  {
15791  DRV_USART_TasksError (object);
15792  // Do other tasks
15793  }
15794  </code>
15795  Remarks:
15796  This routine is normally not called directly by an application. It is
15797  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15798  ISR.
15799  This routine may execute in an ISR context and will never block or access any
15800  resources that may cause it to block.
15801 */
15802 
15803 void
15805  SYS_MODULE_OBJ object ) ;
15806 // *****************************************************************************
15807 // *****************************************************************************
15808 // Section: USART Driver Client Routines
15809 // *****************************************************************************
15810 // *****************************************************************************
15811 // *****************************************************************************
15812 /* Function:
15813  DRV_HANDLE DRV_USART_Open
15814  (
15815  const SYS_MODULE_INDEX index,
15816  const DRV_IO_INTENT ioIntent
15817  )
15818  Summary:
15819  Opens the specified USART driver instance and returns a handle to it.
15820  <p><b>Implementation:</b> Static/Dynamic</p>
15821  Description:
15822  This routine opens the specified USART driver instance and provides a
15823  handle that must be provided to all other client-level operations to
15824  identify the caller and the instance of the driver. The ioIntent
15825  parameter defines how the client interacts with this driver instance.
15826  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15827  additionally affect the behavior of the DRV_USART_Read and
15828  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15829  then these function will not block even if the required amount of data could
15830  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15831  will block until the required amount of data is processed. If the driver is
15832  configured for polling and bare-metal operation, it will not support
15833  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15834  non-blocking.
15835  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15836  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15837  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15838  client will be able to do both, read and write.
15839  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15840  exclusive access to this client. The driver cannot be opened by any
15841  other client.
15842  Precondition:
15843  Function DRV_USART_Initialize must have been called before calling this
15844  function.
15845  Parameters:
15846  index - Identifier for the object instance to be opened
15847  intent - Zero or more of the values from the enumeration
15848  DRV_IO_INTENT "ORed" together to indicate the intended use
15849  of the driver. See function description for details.
15850  Returns:
15851  If successful, the routine returns a valid open-instance handle (a number
15852  identifying both the caller and the module instance).
15853  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15854  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15855  insufficient.
15856  - if the client is trying to open the driver but driver has been opened
15857  exclusively by another client.
15858  - if the driver hardware instance being opened is not initialized or is
15859  invalid.
15860  - if the client is trying to open the driver exclusively, but has already
15861  been opened in a non exclusive mode by another client.
15862  - if the driver is not ready to be opened, typically when the initialize
15863  routine has not completed execution.
15864  Example:
15865  <code>
15866  DRV_HANDLE handle;
15867  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15868  if (DRV_HANDLE_INVALID == handle)
15869  {
15870  // Unable to open the driver
15871  // May be the driver is not initialized or the initialization
15872  // is not complete.
15873  }
15874  </code>
15875  Remarks:
15876  The handle returned is valid until the DRV_USART_Close routine is called.
15877  This routine will NEVER block waiting for hardware.If the requested intent
15878  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15879  function is thread safe in a RTOS application.
15880 */
15881 
15882 DRV_HANDLE
15883  DRV_USART_Open (
15884  const SYS_MODULE_INDEX index ,
15885  const DRV_IO_INTENT ioIntent ) ;
15886 // *****************************************************************************
15887 /* Function:
15888  void DRV_USART_Close( DRV_Handle handle )
15889  Summary:
15890  Closes an opened-instance of the USART driver.
15891  <p><b>Implementation:</b> Static/Dynamic</p>
15892  Description:
15893  This routine closes an opened-instance of the USART driver, invalidating the
15894  handle. Any buffers in the driver queue that were submitted by this client
15895  will be removed. After calling this routine, the handle passed in "handle"
15896  must not be used with any of the remaining driver routines (with one
15897  possible exception described in the "Remarks" section). A new handle must
15898  be obtained by calling DRV_USART_Open before the caller may use the driver
15899  again
15900  Precondition:
15901  The DRV_USART_Initialize routine must have been called for the specified
15902  USART driver instance.
15903  DRV_USART_Open must have been called to obtain a valid opened device handle.
15904  Parameters:
15905  handle - A valid open-instance handle, returned from the driver's
15906  open routine
15907  Returns:
15908  None.
15909  Example:
15910  <code>
15911  DRV_HANDLE handle; // Returned from DRV_USART_Open
15912  DRV_USART_Close(handle);
15913  // After this point, the handle cannot be used with any other function
15914  // except the DRV_USART_ClientStatus function, which can be used to query
15915  // the success status of the DRV_USART_Close function.
15916  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15917  </code>
15918  Remarks:
15919  Usually there is no need for the client to verify that the Close operation
15920  has completed. The driver will abort any ongoing operations when this
15921  routine is called. However, if it requires additional time to do so in a
15922  non-blocking environment, it will still return from the Close operation but
15923  the handle is now a zombie handle. The client can only call the
15924  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15925  Close operation. The DRV_USART_ClientStatus routine will return
15926  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15927 */
15928 
15929 void
15930  DRV_USART_Close (
15931  const DRV_HANDLE handle ) ;
15932 // *****************************************************************************
15933 /*
15934  Function:
15935  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15936  Summary:
15937  Gets the current client-specific status the USART driver.
15938  <p><b>Implementation:</b> Static/Dynamic</p>
15939  Description:
15940  This function gets the client-specific status of the USART driver associated
15941  with the given handle. This function can be used to check the status of
15942  client after the DRV_USART_Close() function has been called.
15943  Preconditions:
15944  The DRV_USART_Initialize function must have been called.
15945  DRV_USART_Open must have been called to obtain a valid opened device
15946  handle.
15947  Parameters:
15948  handle - Handle returned from the driver's open function.
15949  Returns:
15950  A DRV_USART_CLIENT_STATUS value describing the current status of the
15951  driver.
15952  Example:
15953  <code>
15954  DRV_HANDLE handle; // Returned from DRV_USART_Open
15955  DRV_USART_CLIENT_STATUS status;
15956  status = DRV_USART_ClientStatus(handle);
15957  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15958  {
15959  // The client had not closed.
15960  }
15961  </code>
15962  Remarks:
15963  This function will not block for hardware access and will immediately return
15964  the current status. This function is thread safe when called in a RTOS
15965  application.
15966 */
15967 
15970  DRV_HANDLE handle ) ;
15971 // *****************************************************************************
15972 // *****************************************************************************
15973 // Section: USART Driver Buffer Queuing Model Interface Routines
15974 // *****************************************************************************
15975 // *****************************************************************************
15976 // *****************************************************************************
15977 /* Function:
15978  void DRV_USART_BufferAddWrite
15979  (
15980  const DRV_HANDLE handle,
15981  DRV_USART_BUFFER_HANDLE * bufferHandle,
15982  void * buffer,
15983  size_t size
15984  );
15985  Summary:
15986  Schedule a non-blocking driver write operation.
15987  <p><b>Implementation:</b> Static/Dynamic</p>
15988  Description:
15989  This function schedules a non-blocking write operation. The function returns
15990  with a valid buffer handle in the bufferHandle argument if the write request
15991  was scheduled successfully. The function adds the request to the hardware
15992  instance transmit queue and returns immediately. While the request is in the
15993  queue, the application buffer is owned by the driver and should not be
15994  modified. On returning, the bufferHandle parameter may be
15995  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15996  - if a buffer could not be allocated to the request
15997  - if the input buffer pointer is NULL
15998  - if the client opened the driver for read-only
15999  - if the buffer size is 0
16000  - if the transmit queue is full or the queue depth is insufficient
16001  If the requesting client registered an event callback with the driver, the
16002  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16003  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16004  was not processed successfully.
16005  Precondition:
16006  The DRV_USART_Initialize routine must have been called for the specified
16007  USART device instance and the DRV_USART_Status must have returned
16008  SYS_STATUS_READY.
16009  DRV_USART_Open must have been called to obtain a valid opened device handle.
16010  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16011  the DRV_USART_Open call.
16012  Parameters:
16013  handle - Handle of the communication channel as return by the
16014  DRV_USART_Open function.
16015  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16016  buffer - Data to be transmitted.
16017  size - Buffer size in bytes.
16018  Returns:
16019  The bufferHandle parameter will contain the return buffer handle. This will be
16020  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16021  Example:
16022  <code>
16023  MY_APP_OBJ myAppObj;
16024  uint8_t mybuffer[MY_BUFFER_SIZE];
16025  DRV_USART_BUFFER_HANDLE bufferHandle;
16026  // myUSARTHandle is the handle returned
16027  // by the DRV_USART_Open function.
16028  // Client registers an event handler with driver
16029  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16030  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16031  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16032  myBuffer, MY_BUFFER_SIZE);
16033  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16034  {
16035  // Error handling here
16036  }
16037  // Event is received when
16038  // the buffer is processed.
16039  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16040  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16041  {
16042  // contextHandle points to myAppObj.
16043  switch(event)
16044  {
16045  case DRV_USART_BUFFER_EVENT_COMPLETE:
16046  // This means the data was transferred.
16047  break;
16048  case DRV_USART_BUFFER_EVENT_ERROR:
16049  // Error handling here.
16050  break;
16051  default:
16052  break;
16053  }
16054  }
16055  </code>
16056  Remarks:
16057  This function is thread safe in a RTOS application. It can be called from
16058  within the USART Driver Buffer Event Handler that is registered by this
16059  client. It should not be called in the event handler associated with another
16060  USART driver instance. It should not otherwise be called directly in an ISR.
16061 */
16062 
16063 void
16065  const DRV_HANDLE handle ,
16066  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16067  void * buffer ,
16068  const size_t size ) ;
16069 // *****************************************************************************
16070 /* Function:
16071  void DRV_USART_AddressedBufferAddWrite
16072  (
16073  const DRV_HANDLE hClient,
16074  DRV_USART_BUFFER_HANDLE * bufferHandle,
16075  uint8_t address,
16076  void * source,
16077  size_t nWords
16078  );
16079  Summary:
16080  Schedule a non-blocking addressed driver write operation.
16081  <p><b>Implementation:</b> Dynamic</p>
16082  Description:
16083  This function schedules a non-blocking addressed write operation. The function returns
16084  with a valid buffer handle in the bufferHandle argument if the addressed write request
16085  was scheduled successfully. The function adds the request to the hardware
16086  instance transmit queue and returns immediately. While the request is in the
16087  queue, the application buffer is owned by the driver and should not be
16088  modified. On returning, the bufferHandle parameter may be
16089  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16090  - if a buffer could not be allocated to the request
16091  - if the input buffer pointer is NULL
16092  - if the client opened the driver for read-only
16093  - if the buffer size is 0
16094  - if the transmit queue is full or the queue depth is insufficient
16095  If the requesting client registered an event callback with the driver, the
16096  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16097  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16098  was not processed successfully.
16099  Precondition:
16100  The DRV_USART_Initialize routine must have been called for the specified
16101  USART device instance and the DRV_USART_Status must have returned
16102  SYS_STATUS_READY.
16103  DRV_USART_Open must have been called to obtain a valid opened device handle.
16104  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16105  the DRV_USART_Open call.
16106  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16107  Parameters:
16108  hClient - Handle of the communication channel as return by the
16109  DRV_USART_Open function.
16110  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16111  address - Address of the receiver client
16112  source - Data to be transmitted.
16113  size - Buffer size in 16-bit words.
16114  Returns:
16115  The bufferHandle parameter will contain the return buffer handle. This will be
16116  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16117  Example:
16118  <code>
16119  MY_APP_OBJ myAppObj;
16120  uint16_t mybuffer[MY_BUFFER_SIZE];
16121  DRV_USART_BUFFER_HANDLE bufferHandle;
16122  uint8_t clientAddress;
16123  // myUSARTHandle is the handle returned
16124  // by the DRV_USART_Open function.
16125  // Client registers an event handler with driver
16126  clientAddress = 0x60;
16127  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16128  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16129  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16130  myBuffer, MY_BUFFER_SIZE);
16131  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16132  {
16133  // Error handling here
16134  }
16135  // Event is received when
16136  // the buffer is processed.
16137  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16138  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16139  {
16140  // contextHandle points to myAppObj.
16141  switch(event)
16142  {
16143  case DRV_USART_BUFFER_EVENT_COMPLETE:
16144  // This means the data was transferred.
16145  break;
16146  case DRV_USART_BUFFER_EVENT_ERROR:
16147  // Error handling here.
16148  break;
16149  default:
16150  break;
16151  }
16152  }
16153  </code>
16154  Remarks:
16155  This function is thread safe in a RTOS application. It can be called from
16156  within the USART Driver Buffer Event Handler that is registered by this
16157  client. It should not be called in the event handler associated with another
16158  USART driver instance. It should not otherwise be called directly in an ISR.
16159  The source buffer should be a 16-bit word aligned buffer.
16160  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16161 */
16162 
16163 void
16165  const DRV_HANDLE hClient ,
16166  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16167  uint8_t address ,
16168  void * source ,
16169  size_t nWords ) ;
16170 // *****************************************************************************
16171 /* Function:
16172  void DRV_USART_BufferAddRead
16173  (
16174  const DRV_HANDLE handle,
16175  DRV_USART_BUFFER_HANDLE * bufferHandle,
16176  void * buffer,
16177  const size_t size
16178  )
16179  Summary:
16180  Schedule a non-blocking driver read operation.
16181  <p><b>Implementation:</b> Static/Dynamic</p>
16182  Description:
16183  This function schedules a non-blocking read operation. The function returns
16184  with a valid buffer handle in the bufferHandle argument if the read request
16185  was scheduled successfully. The function adds the request to the hardware
16186  instance receive queue and returns immediately. While the request is in the
16187  queue, the application buffer is owned by the driver and should not be
16188  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16189  bufferHandle argument:
16190  - if a buffer could not be allocated to the request
16191  - if the input buffer pointer is NULL
16192  - if the buffer size is 0
16193  - if the read queue size is full or queue depth is insufficient.
16194  - if the driver handle is invalid
16195  If the requesting client registered an event callback with the driver, the
16196  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16197  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16198  was not processed successfully.
16199  Precondition:
16200  The DRV_USART_Initialize routine must have been called for the specified
16201  USART device instance and the DRV_USART_Status must have returned
16202  SYS_STATUS_READY.
16203  DRV_USART_Open must have been called to obtain a valid opened device handle.
16204  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16205  the DRV_USART_Open call.
16206  Parameters:
16207  handle - Handle of the communication channel as returned by the
16208  DRV_USART_Open function.
16209  buffer - Buffer where the received data will be stored.
16210  size - Buffer size in bytes.
16211  Returns:
16212  The buffer handle is returned in the bufferHandle argument. This is
16213  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16214  Example:
16215  <code>
16216  MY_APP_OBJ myAppObj;
16217  uint8_t mybuffer[MY_BUFFER_SIZE];
16218  DRV_USART_BUFFER_HANDLE bufferHandle;
16219  // myUSARTHandle is the handle returned
16220  // by the DRV_USART_Open function.
16221  // Client registers an event handler with driver
16222  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16223  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16224  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16225  myBuffer, MY_BUFFER_SIZE);
16226  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16227  {
16228  // Error handling here
16229  }
16230  // Event is received when
16231  // the buffer is processed.
16232  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16233  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16234  {
16235  // contextHandle points to myAppObj.
16236  switch(event)
16237  {
16238  case DRV_USART_BUFFER_EVENT_COMPLETE:
16239  // This means the data was transferred.
16240  break;
16241  case DRV_USART_BUFFER_EVENT_ERROR:
16242  // Error handling here.
16243  break;
16244  default:
16245  break;
16246  }
16247  }
16248  </code>
16249  Remarks:
16250  This function is thread safe in a RTOS application. It can be called from
16251  within the USART Driver Buffer Event Handler that is registered by the
16252  client. It should not be called in the event handler associated with another
16253  USART driver instance. It should not be called directly in an ISR.
16254 */
16255 
16256 void
16258  const DRV_HANDLE handle ,
16259  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16260  void * buffer ,
16261  const size_t size ) ;
16262 // *****************************************************************************
16263 /* Function:
16264  void DRV_USART_BufferEventHandlerSet
16265  (
16266  const DRV_HANDLE handle,
16267  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16268  const uintptr_t context
16269  )
16270  Summary:
16271  Allows a client to identify a buffer event handling function for the driver
16272  to call back when queued buffer transfers have finished.
16273  <p><b>Implementation:</b> Static/Dynamic</p>
16274  Description:
16275  This function allows a client to identify a buffer event handling function
16276  for the driver to call back when queued buffer transfers have finished.
16277  When a client calls either the DRV_USART_BufferAddRead or
16278  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16279  the buffer that was added to the driver's buffer queue. The driver will
16280  pass this handle back to the client by calling "eventHandler" function when
16281  the buffer transfer has completed.
16282  The event handler should be set before the client performs any "buffer add"
16283  operations that could generate events. The event handler once set, persists
16284  until the client closes the driver or sets another event handler (which
16285  could be a "NULL" pointer to indicate no callback).
16286  Precondition:
16287  The DRV_USART_Initialize routine must have been called for the specified
16288  USART driver instance.
16289  DRV_USART_Open must have been called to obtain a valid opened device handle.
16290  Parameters:
16291  handle - A valid open-instance handle, returned from the driver's
16292  open routine
16293  eventHandler - Pointer to the event handler function.
16294  context - The value of parameter will be passed back to the client
16295  unchanged, when the eventHandler function is called. It can
16296  be used to identify any client specific data object that
16297  identifies the instance of the client module (for example,
16298  it may be a pointer to the client module's state structure).
16299  Returns:
16300  None.
16301  Example:
16302  <code>
16303  // myAppObj is an application specific state data object.
16304  MY_APP_OBJ myAppObj;
16305  uint8_t mybuffer[MY_BUFFER_SIZE];
16306  DRV_USART_BUFFER_HANDLE bufferHandle;
16307  // myUSARTHandle is the handle returned
16308  // by the DRV_USART_Open function.
16309  // Client registers an event handler with driver. This is done once
16310  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16311  (uintptr_t)&myAppObj );
16312  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16313  myBuffer, MY_BUFFER_SIZE);
16314  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16315  {
16316  // Error handling here
16317  }
16318  // Event Processing Technique. Event is received when
16319  // the buffer is processed.
16320  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16321  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16322  {
16323  // The context handle was set to an application specific
16324  // object. It is now retrievable easily in the event handler.
16325  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16326  switch(event)
16327  {
16328  case DRV_USART_BUFFER_EVENT_COMPLETE:
16329  // This means the data was transferred.
16330  break;
16331  case DRV_USART_BUFFER_EVENT_ERROR:
16332  // Error handling here.
16333  break;
16334  default:
16335  break;
16336  }
16337  }
16338  </code>
16339  Remarks:
16340  If the client does not want to be notified when the queued buffer transfer
16341  has completed, it does not need to register a callback. This function is
16342  thread safe when called in a RTOS application.
16343 */
16344 
16345 void
16347  const DRV_HANDLE handle ,
16348  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16349  const uintptr_t context ) ;
16350 // *****************************************************************************
16351 /* Function:
16352  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16353  Summary:
16354  Removes a requested buffer from the queue.
16355  <p><b>Implementation:</b> Static/Dynamic</p>
16356  Description:
16357  This function removes a specified buffer from the queue.
16358  The client can use this function to delete
16359  1. An unwated stalled buffer.
16360  2. Queued buffers on timeout.
16361  or in any other use case.
16362  Precondition:
16363  The DRV_USART_Initialize routine must have been called for the specified
16364  USART driver instance.
16365  DRV_USART_Open must have been called to obtain a valid opened device handle.
16366  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16367  must have been called and a valid buffer handle returned.
16368  Parameters:
16369  bufferhandle - Handle of the buffer to delete.
16370  Returns:
16371  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16372  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16373  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16374  queue successfully.
16375  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16376  the queue because of mutex timeout in RTOS environment.
16377  Example:
16378  <code>
16379  // myAppObj is an application specific object.
16380  MY_APP_OBJ myAppObj;
16381  uint8_t mybuffer[MY_BUFFER_SIZE];
16382  DRV_USART_BUFFER_HANDLE bufferHandle;
16383  // myUSARTHandle is the handle returned
16384  // by the DRV_USART_Open function.
16385  // Client registers an event handler with driver. This is done once
16386  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16387  (uintptr_t)&myAppObj );
16388  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16389  myBuffer, MY_BUFFER_SIZE );
16390  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16391  {
16392  // Error handling here
16393  }
16394  // Event Processing Technique. Event is received when
16395  // the buffer is processed.
16396  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16397  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16398  {
16399  switch(event)
16400  {
16401  case DRV_USART_BUFFER_EVENT_COMPLETE:
16402  // This means the data was transferred.
16403  break;
16404  case DRV_USART_BUFFER_EVENT_ERROR:
16405  // Error handling here.
16406  break;
16407  default:
16408  break;
16409  }
16410  }
16411  // Timeout function, where remove queued buffer if it still exists.
16412  void APP_TimeOut(void)
16413  {
16414  DRV_USART_BUFFER_RESULT bufferResult;
16415  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16416  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16417  {
16418  //Buffer removed succesfully from the queue
16419  }
16420  else
16421  {
16422  //Either buffer is invalid or expired.
16423  //Or not able to acquire mutex in RTOS mode.
16424  }
16425  }
16426  </code>
16427  Remarks:
16428  This function is thread safe when used in a RTOS application.
16429 */
16430 
16433  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16434 // *****************************************************************************
16435 /* Function:
16436  size_t DRV_USART_BufferCompletedBytesGet
16437  (
16438  DRV_USART_BUFFER_HANDLE bufferHandle
16439  );
16440  Summary:
16441  Returns the number of bytes that have been processed for the
16442  specified buffer.
16443  <p><b>Implementation:</b> Static/Dynamic</p>
16444  Description:
16445  This function returns number of bytes that have been processed for the
16446  specified buffer. The client can use this function, in a case where the
16447  buffer has terminated due to an error, to obtain the number of bytes that
16448  have been processed. Or in any other use case.
16449  This function can be used for non-DMA buffer transfers only. It cannot be
16450  used when the USART driver is configured to use DMA.
16451  Precondition:
16452  The DRV_USART_Initialize routine must have been called for the specified
16453  USART driver instance.
16454  DRV_USART_Open must have been called to obtain a valid opened device handle.
16455  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16456  must have been called and a valid buffer handle returned.
16457  Parameters:
16458  bufferhandle - Handle for the buffer of which the processed number of bytes
16459  to be obtained.
16460  Returns:
16461  Returns the number of bytes that have been processed for this buffer.
16462  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16463  buffer handle.
16464  Example:
16465  <code>
16466  // myAppObj is an application specific object.
16467  MY_APP_OBJ myAppObj;
16468  uint8_t mybuffer[MY_BUFFER_SIZE];
16469  DRV_USART_BUFFER_HANDLE bufferHandle;
16470  // myUSARTHandle is the handle returned
16471  // by the DRV_USART_Open function.
16472  // Client registers an event handler with driver. This is done once
16473  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16474  (uintptr_t)&myAppObj );
16475  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16476  myBuffer, MY_BUFFER_SIZE );
16477  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16478  {
16479  // Error handling here
16480  }
16481  // Event Processing Technique. Event is received when
16482  // the buffer is processed.
16483  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16484  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16485  {
16486  // The context handle was set to an application specific
16487  // object. It is now retrievable easily in the event handler.
16488  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16489  size_t processedBytes;
16490  switch(event)
16491  {
16492  case DRV_USART_BUFFER_EVENT_COMPLETE:
16493  // This means the data was transferred.
16494  break;
16495  case DRV_USART_BUFFER_EVENT_ERROR:
16496  // Error handling here.
16497  // We can find out how many bytes were processed in this
16498  // buffer before the error occurred.
16499  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16500  break;
16501  default:
16502  break;
16503  }
16504  }
16505  </code>
16506  Remarks:
16507  This function is thread safe when used in a RTOS application.
16508 */
16509 
16510 size_t
16512  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16513 // *****************************************************************************
16514 /* Function:
16515  size_t DRV_USART_BufferProcessedSizeGet
16516  (
16517  DRV_USART_BUFFER_HANDLE bufferHandle
16518  );
16519  Summary:
16520  This API will be deprecated and not recommended to use.
16521  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16522  processed for the specified buffer.
16523  Description:
16524  None.
16525  Precondition:
16526  None.
16527  Parameters:
16528  None.
16529  Returns:
16530  None.
16531  Example:
16532  None.
16533  Remarks:
16534  None.
16535 */
16536 
16537 size_t
16539  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16540 // *****************************************************************************
16541 // *****************************************************************************
16542 // Section: USART Driver File System Model Routines
16543 // *****************************************************************************
16544 // *****************************************************************************
16545 // *****************************************************************************
16546 /* Function:
16547  size_t DRV_USART_Read
16548  (
16549  const DRV_HANDLE handle,
16550  void * buffer,
16551  const size_t numbytes
16552  )
16553  Summary:
16554  Reads data from the USART.
16555  <p><b>Implementation:</b> Static/Dynamic</p>
16556  Description:
16557  This routine reads data from the USART. This function is blocking if the
16558  driver was opened by the client for blocking operation. This function will
16559  not block if the driver was opened by the client for non blocking operation.
16560  If the ioIntent parameter at the time of opening the driver was
16561  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16562  until) numbytes of bytes have been received or if an error occurred. If there
16563  are buffers queued for receiving data, these buffers will be serviced first. The
16564  function will not return until the requested number of bytes have been read.
16565  If the ioIntent parameter at the time of opening the driver was
16566  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16567  bytes that were actually read. The function will not wait until numBytes of
16568  bytes have been read. If there are buffer queued for reading data, then the
16569  function will not block and will return immediately with 0 bytes read.
16570  Precondition:
16571  The DRV_USART_Initialize routine must have been called for the specified
16572  USART driver instance.
16573  DRV_USART_Open must have been called to obtain a valid opened device handle.
16574  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16575  the DRV_USART_Open call.
16576  Parameters:
16577  handle - A valid open-instance handle, returned from the driver's
16578  open routine
16579  buffer - Buffer into which the data read from the USART instance
16580  will be placed.
16581  numbytes - Total number of bytes that need to be read from the module
16582  instance (must be equal to or less than the size of the
16583  buffer)
16584  Returns:
16585  Number of bytes actually copied into the caller's buffer. Returns
16586  DRV_USART_READ_ERROR in case of an error.
16587  Example:
16588  <code>
16589  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16590  char myBuffer[MY_BUFFER_SIZE];
16591  unsigned int count;
16592  unsigned int total;
16593  total = 0;
16594  do
16595  {
16596  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16597  if(count == DRV_USART_READ_ERROR)
16598  {
16599  // There was an error. The DRV_USART_ErrorGet() function
16600  // can be called to find the exact error.
16601  }
16602  total += count;
16603  // Do something else...
16604  } while( total < MY_BUFFER_SIZE );
16605  </code>
16606  Remarks:
16607  This function is thread safe in a RTOS application. If the driver is
16608  configured for polled operation, this it will not support blocking operation
16609  in a bare metal (non-RTOS) application.
16610 */
16611 
16612 size_t
16613  DRV_USART_Read (
16614  const DRV_HANDLE handle ,
16615  void * buffer ,
16616  const size_t numbytes ) ;
16617 // *****************************************************************************
16618 /* Function:
16619  size_t DRV_USART_Write
16620  (
16621  const DRV_HANDLE handle,
16622  void * buffer,
16623  const size_t numbytes
16624  )
16625  Summary:
16626  Writes data to the USART.
16627  <p><b>Implementation:</b> Static/Dynamic</p>
16628  Description:
16629  This routine writes data to the USART. This function is blocking if the
16630  driver was opened by the client for blocking operation. This function will
16631  not block if the driver was opened by the client for non blocking operation.
16632  If the ioIntent parameter at the time of opening the driver was
16633  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16634  until) numbytes of bytes have been transmitted or if an error occurred. If
16635  there are buffers queued for writing, the function will wait until all the
16636  preceding buffers are completed. Ongoing buffer transmit operations will not
16637  be affected.
16638  If the ioIntent parameter at the time of opening the driver was
16639  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16640  bytes that were actually accepted for transmission. The function will not
16641  wait until numBytes of bytes have been transmitted. If there a buffers queued
16642  for transmit, the function will not wait and will return immediately with 0
16643  bytes.
16644  Precondition:
16645  The DRV_USART_Initialize routine must have been called for the specified
16646  USART driver instance.
16647  DRV_USART_Open must have been called to obtain a valid opened device handle.
16648  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16649  the DRV_USART_Open call.
16650  Parameters:
16651  handle - A valid open-instance handle, returned from the driver's
16652  open routine
16653  buffer - Buffer containing the data to written.
16654  numbytes - size of the buffer
16655  Returns:
16656  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16657  in case of an error.
16658  Example:
16659  <code>
16660  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16661  char myBuffer[MY_BUFFER_SIZE];
16662  int count;
16663  unsigned int total;
16664  total = 0;
16665  do
16666  {
16667  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16668  MY_BUFFER_SIZE - total);
16669  total += count;
16670  // Do something else...
16671  } while( total < MY_BUFFER_SIZE );
16672  </code>
16673  Remarks:
16674  This function is thread safe in a RTOS application. This function is thread
16675  safe in a RTOS application. If the driver is configured for polled
16676  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16677  application.
16678 */
16679 
16680 size_t
16681  DRV_USART_Write (
16682  const DRV_HANDLE handle ,
16683  void * buffer ,
16684  const size_t numbytes ) ;
16685 // *****************************************************************************
16686 /* Function:
16687  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16688  Summary:
16689  Returns the transmitter and receiver transfer status.
16690  <p><b>Implementation:</b> Static/Dynamic</p>
16691  Description:
16692  This returns the transmitter and receiver transfer status.
16693  Precondition:
16694  The DRV_USART_Initialize routine must have been called for the specified
16695  USART driver instance.
16696  DRV_USART_Open must have been called to obtain a valid opened device handle.
16697  Parameters:
16698  handle - A valid open-instance handle, returned from the driver's
16699  open routine
16700  Returns:
16701  A DRV_USART_TRANSFER_STATUS value describing the current status
16702  of the transfer.
16703  Example:
16704  <code>
16705  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16706  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16707  {
16708  // Data has been received that can be read
16709  }
16710  </code>
16711  Remarks:
16712  The returned status may contain a value with more than one of the bits
16713  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16714  should perform an "AND" with the bit of interest and verify if the result is
16715  non-zero (as shown in the example) to verify the desired status bit. This
16716  function is thread safe when called in a RTOS application.
16717 */
16718 
16721  const DRV_HANDLE handle ) ;
16722 // *****************************************************************************
16723 // *****************************************************************************
16724 // Section: USART Driver Byte Model Routines
16725 // *****************************************************************************
16726 // *****************************************************************************
16727 // *****************************************************************************
16728 /* Function:
16729  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16730  Summary:
16731  Reads a byte of data from the USART.
16732  <p><b>Implementation:</b> Static/Dynamic</p>
16733  Description:
16734  This routine reads a byte of data from the USART.
16735  Precondition:
16736  The DRV_USART_Initialize routine must have been called for the specified
16737  USART driver instance.
16738  DRV_USART_Open must have been called to obtain a valid opened device handle.
16739  The transfer status should be checked to see if the receiver is not empty
16740  before calling this function.
16741  Parameters:
16742  handle - A valid open-instance handle, returned from the driver's
16743  open routine
16744  Returns:
16745  A data byte received by the driver.
16746  Example:
16747  <code>
16748  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16749  char myBuffer[MY_BUFFER_SIZE];
16750  unsigned int numBytes;
16751  numBytes = 0;
16752  do
16753  {
16754  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16755  {
16756  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16757  }
16758  // Do something else...
16759  } while( numBytes < MY_BUFFER_SIZE);
16760  </code>
16761  Remarks:
16762  This function is thread safe when called in a RTOS application. Note that
16763  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16764  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16765  DRV_USART_Write functions in a application. Calling the
16766  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16767  processing of any queued buffers.
16768 */
16769 
16770 uint8_t
16772  const DRV_HANDLE handle ) ;
16773 // *****************************************************************************
16774 /* Function:
16775  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16776  Summary:
16777  Writes a byte of data to the USART.
16778  <p><b>Implementation:</b> Static/Dynamic</p>
16779  Description:
16780  This routine writes a byte of data to the USART.
16781  Precondition:
16782  The DRV_USART_Initialize routine must have been called for the specified
16783  USART driver instance.
16784  DRV_USART_Open must have been called to obtain a valid opened device handle.
16785  The transfer status should be checked to see if transmitter is not full
16786  before calling this function.
16787  Parameters:
16788  handle - A valid open-instance handle, returned from the driver's
16789  open routine
16790  byte - Data byte to write to the USART
16791  Returns:
16792  None.
16793  Example:
16794  <code>
16795  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16796  char myBuffer[MY_BUFFER_SIZE];
16797  unsigned int numBytes;
16798  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16799  numBytes = 0;
16800  while( numBytes < MY_BUFFER_SIZE );
16801  {
16802  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16803  {
16804  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16805  }
16806  // Do something else...
16807  }
16808  </code>
16809  Remarks:
16810  This function is thread safe when called in a RTOS application. Note that
16811  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16812  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16813  DRV_USART_Write functions in a application. Calling the
16814  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16815  processing of any queued buffers.
16816 */
16817 
16818 void
16820  const DRV_HANDLE handle ,
16821  const uint8_t byte ) ;
16822 // *****************************************************************************
16823 /* Function:
16824  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16825  Summary:
16826  Returns the size of the receive buffer.
16827  <p><b>Implementation:</b> Static/Dynamic</p>
16828  Description:
16829  This routine returns the size of the receive buffer.
16830  Precondition:
16831  The DRV_USART_Initialize routine must have been called for the specified
16832  USART driver instance.
16833  DRV_USART_Open must have been called to obtain a valid opened device handle.
16834  Parameters:
16835  handle - A valid open-instance handle, returned from the driver's
16836  open routine
16837  Returns:
16838  Size of the driver's receive buffer, in bytes.
16839  Example:
16840  <code>
16841  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16842  const uint8_t readBuffer[5];
16843  unsigned int size, numBytes = 0;
16844  unsigned int readbufferLen = sizeof(readBuffer);
16845  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16846  // Do something based on the receiver buffer size
16847  </code>
16848  Remarks:
16849  Does not account for client queued buffers. This function is thread safe
16850  when called in a RTOS application.
16851 */
16852 
16853 unsigned int
16855  const DRV_HANDLE handle ) ;
16856 // *****************************************************************************
16857 /* Function:
16858  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16859  Summary:
16860  Returns the size of the transmit buffer.
16861  <p><b>Implementation:</b> Static/Dynamic</p>
16862  Description:
16863  This routine returns the size of the transmit buffer and can be used by the
16864  application to determine the number of bytes to write with the
16865  DRV_USART_WriteByte function.
16866  Precondition:
16867  The DRV_USART_Initialize routine must have been called for the specified
16868  USART driver instance.
16869  DRV_USART_Open must have been called to obtain a valid opened device handle.
16870  Parameters:
16871  handle - A valid open-instance handle, returned from the driver's
16872  open routine
16873  Returns:
16874  Size of the driver's transmit buffer, in bytes.
16875  Examples:
16876  <code>
16877  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16878  const uint8_t writeBuffer[5];
16879  unsigned int size, numBytes = 0;
16880  unsigned int writeBufferLen = sizeof(writeBuffer);
16881  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16882  // Do something based on the transmitter buffer size
16883  </code>
16884  Remarks:
16885  Does not account for client queued buffers. This function is thread safe
16886  when used in a RTOS application.
16887 */
16888 
16889 unsigned int
16891  const DRV_HANDLE handle ) ;
16892 // *****************************************************************************
16893 /* Function:
16894  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16895  Summary:
16896  Provides the status of the driver's receive buffer.
16897  <p><b>Implementation:</b> Static/Dynamic</p>
16898  Description:
16899  This routine indicates if the driver's receiver buffer is empty. This
16900  function can be used in conjunction with the DRV_USART_Read and
16901  DRV_USART_ReadByte functions.
16902  Precondition:
16903  The DRV_USART_Initialize routine must have been called for the specified
16904  USART driver instance.
16905  DRV_USART_Open must have been called to obtain a valid opened device handle.
16906  Parameters:
16907  handle - A valid open-instance handle, returned from the driver's
16908  open routine
16909  Returns:
16910  true - if the driver's receive buffer is empty
16911  false - if the driver's receive buffer is not empty
16912  Example:
16913  <code>
16914  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16915  char myBuffer[MY_BUFFER_SIZE];
16916  unsigned int numBytes;
16917  numBytes = 0;
16918  while( numBytes < MY_BUFFER_SIZE );
16919  {
16920  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16921  {
16922  if( numBytes < MY_BUFFER_SIZE )
16923  {
16924  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16925  }
16926  else
16927  {
16928  break;
16929  }
16930  }
16931  // Do something else while more data is received.
16932  }
16933  </code>
16934  Remarks:
16935  Does not account for client queued buffers. This function is safe thread
16936  safe when used in a RTOS application.
16937 */
16938 
16939 bool
16941  const DRV_HANDLE handle ) ;
16942 // *****************************************************************************
16943 /* Function:
16944  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16945  Summary:
16946  Provides the status of the driver's transmit buffer.
16947  <p><b>Implementation:</b> Static/Dynamic</p>
16948  Description:
16949  This routine identifies if the driver's transmit buffer is full or not. This
16950  function can be used in conjunction with the DRV_USART_Write and
16951  DRV_USART_WriteByte functions.
16952  Precondition:
16953  The DRV_USART_Initialize routine must have been called for the specified
16954  USART driver instance.
16955  DRV_USART_Open must have been called to obtain a valid opened device handle.
16956  Parameters:
16957  handle - A valid open-instance handle, returned from the driver's
16958  open routine
16959  Returns:
16960  true - if the transmit buffer is full
16961  false - if the transmit buffer is not full
16962  Example:
16963  <code>
16964  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16965  unsigned int numBytes;
16966  int bytesToWrite;
16967  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16968  int writebufferLen = strlen((char *)writeBuffer);
16969  numBytes = 0;
16970  while( numBytes < writebufferLen )
16971  {
16972  if (DRV_USART_TransmitBufferisFull())
16973  {
16974  // Do something else until there is some room in the driver's Transmit buffer.
16975  }
16976  else
16977  {
16978  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16979  }
16980  }
16981  </code>
16982  Remarks:
16983  Does not account for client queued buffers. This function is thread safe
16984  when called in a RTOS application.
16985 */
16986 
16987 bool
16989  const DRV_HANDLE handle ) ;
16990 // *****************************************************************************
16991 /* Function:
16992  void DRV_USART_ByteTransmitCallbackSet
16993  (
16994  const SYS_MODULE_INDEX index,
16995  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16996  )
16997  Summary:
16998  Registers a callback function for byte transmit event.
16999  Description:
17000  This function allows a transmit callback function to be registered with the
17001  driver. The callback function is invoked when a byte has been transmitted
17002  using DRV_USART_WriteByte () function.
17003  The callback function should be registered with the driver prior to any
17004  writes to the driver. The callback functionality is available only in the
17005  interrupt mode of operation. The driver clears the interrupt after invoking
17006  the callback function.
17007  Precondition:
17008  The DRV_USART_Initialize routine must have been called for the specified
17009  USART driver instance.
17010  Parameters:
17011  index - Identifier for the object instance to be opened
17012  eventHandler - Pointer to the event handler function.
17013  Returns:
17014  None.
17015  Example:
17016  <code>
17017  // myAppObj is an application specific state data object.
17018  MY_APP_OBJ myAppObj;
17019  uint8_t mybuffer[MY_BUFFER_SIZE];
17020  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17021  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17022  (uintptr_t)&myAppObj );
17023  // Register an event handler with driver. This is done once
17024  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17025  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17026  // Event Processing Technique. Event is received when
17027  // the byte is transmitted.
17028  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17029  {
17030  // Byte has been transmitted. Handle the event.
17031  }
17032  </code>
17033  Remarks:
17034  None
17035 */
17036 
17037 void
17039  const SYS_MODULE_INDEX index ,
17040  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17041 // *****************************************************************************
17042 /* Function:
17043  void DRV_USART_ByteReceiveCallbackSet
17044  (
17045  const SYS_MODULE_INDEX index,
17046  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17047  )
17048  Summary:
17049  Registers receive callback function for byte receive event.
17050  Description:
17051  This function allows a receive callback function to be registered with the
17052  driver. The callback function is invoked when a byte has been received. The
17053  received byte can then be read using DRV_USART_ReadByte() function.
17054  The callback function should be registered with the driver as part of the
17055  initialization. The callback functionality is available only in the
17056  interrupt mode of operation. The driver clears the interrupt after invoking
17057  the callback function.
17058  Precondition:
17059  The DRV_USART_Initialize routine must have been called for the specified
17060  USART driver instance.
17061  Parameters:
17062  index - Identifier for the object instance to be opened
17063  eventHandler - Pointer to the event handler function.
17064  Returns:
17065  None.
17066  Example:
17067  <code>
17068  // myAppObj is an application specific state data object.
17069  MY_APP_OBJ myAppObj;
17070  uint8_t mybuffer[MY_BUFFER_SIZE];
17071  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17072  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17073  (uintptr_t)&myAppObj );
17074  // Register an event handler with driver. This is done once
17075  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17076  // Event Processing Technique. Event is received when
17077  // a byte is received.
17078  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17079  {
17080  // Byte has been Received. Handle the event.
17081  // Read byte using DRV_USART_ReadByte ()
17082  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17083  // check if the receiver buffer is empty.
17084  }
17085  </code>
17086  Remarks:
17087  None
17088 */
17089 
17090 void
17092  const SYS_MODULE_INDEX index ,
17093  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17094 // *****************************************************************************
17095 /* Function:
17096  void DRV_USART_ByteErrorCallbackSet
17097  (
17098  const SYS_MODULE_INDEX index,
17099  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17100  )
17101  Summary:
17102  Registers callback to handle for byte error events.
17103  Description:
17104  This function allows a callback function to be registered with the driver
17105  to handle the error events occurring in the transmit/receive path during
17106  byte transfers.
17107  The callback function should be registered as part of the initialization.
17108  The callback functionality is available only in the interrupt mode of
17109  operation. The driver clears the interrupt after invoking the callback
17110  function.
17111  Precondition:
17112  The DRV_USART_Initialize routine must have been called for the specified
17113  USART driver instance.
17114  Parameters:
17115  index - Identifier for the object instance to be opened
17116  eventHandler - Pointer to the event handler function.
17117  Returns:
17118  None.
17119  Example:
17120  <code>
17121  // myAppObj is an application specific state data object.
17122  MY_APP_OBJ myAppObj;
17123  uint8_t mybuffer[MY_BUFFER_SIZE];
17124  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17125  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17126  (uintptr_t)&myAppObj );
17127  // Register an event handler with driver. This is done once
17128  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17129  // Event Processing Technique.
17130  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17131  {
17132  // Error has occurred. Handle the event.
17133  }
17134  </code>
17135  Remarks:
17136  None
17137 */
17138 
17139 void
17141  const SYS_MODULE_INDEX index ,
17142  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17143 // *****************************************************************************
17144 // *****************************************************************************
17145 // Section: USART Driver Setup and Status Routines
17146 // *****************************************************************************
17147 // *****************************************************************************
17148 // *****************************************************************************
17149 /* Function:
17150  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17151  Summary:
17152  This function returns the error(if any) associated with the last client
17153  request.
17154  <p><b>Implementation:</b> Static/Dynamic</p>
17155  Description:
17156  This function returns the error(if any) associated with the last client
17157  request. DRV_USART_Read and DRV_USART_Write will update the client
17158  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17159  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17160  call this function to know the error cause. The error status will be updated
17161  on every operation and should be read frequently (ideally immediately after
17162  the driver operation has completed) to know the relevant error status.
17163  Precondition:
17164  The DRV_USART_Initialize routine must have been called for the specified
17165  USART driver instance.
17166  DRV_USART_Open must have been called to obtain a valid opened device handle.
17167  Parameters:
17168  bufferhandle - Handle of the buffer of which the processed number of bytes
17169  to be obtained.
17170  Returns:
17171  A DRV_USART_ERROR type indicating last known error status.
17172  Example:
17173  <code>
17174  // myAppObj is an application specific object.
17175  MY_APP_OBJ myAppObj;
17176  uint8_t mybuffer[MY_BUFFER_SIZE];
17177  DRV_USART_BUFFER_HANDLE bufferHandle;
17178  // myUSARTHandle is the handle returned
17179  // by the DRV_USART_Open function.
17180  // Client registers an event handler with driver. This is done once.
17181  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17182  (uintptr_t)&myAppObj );
17183  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17184  myBuffer, MY_BUFFER_SIZE );
17185  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17186  {
17187  // Error handling here
17188  }
17189  // Event Processing Technique. Event is received when
17190  // the buffer is processed.
17191  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17192  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17193  {
17194  // The context handle was set to an application specific
17195  // object. It is now retrievable easily in the event handler.
17196  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17197  size_t processedBytes;
17198  switch(event)
17199  {
17200  case DRV_USART_BUFFER_EVENT_COMPLETE:
17201  // This means the data was transferred.
17202  break;
17203  case DRV_USART_BUFFER_EVENT_ERROR:
17204  // Error handling here.
17205  // We can find out how many bytes were processed in this
17206  // buffer before the error occurred. We can also find
17207  // the error cause.
17208  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17209  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17210  {
17211  // There was an receive over flow error.
17212  // Do error handling here.
17213  }
17214  break;
17215  default:
17216  break;
17217  }
17218  }
17219  </code>
17220  Remarks:
17221  It is the client's responsibility to make sure that the error status is
17222  obtained frequently. The driver will update the client error status
17223  regardless of whether this has been examined by the client. This function
17224  is thread safe when used in a RTOS application.
17225 */
17226 
17229  const DRV_HANDLE client ) ;
17230 // *****************************************************************************
17231 /* Function:
17232  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17233  Summary:
17234  This function changes the USART module baud to the specified value.
17235  <p><b>Implementation:</b> Static/Dynamic</p>
17236  Description:
17237  This function changes the USART module baud to the specified value. Any
17238  queued buffer requests will be processed at the updated baud. The USART
17239  driver operates at the baud specified in DRV_USART_Initialize function
17240  unless the DRV_USART_BaudSet function is called to change the baud.
17241  Precondition:
17242  The DRV_USART_Initialize routine must have been called for the specified
17243  USART driver instance.
17244  DRV_USART_Open must have been called to obtain a valid opened device handle.
17245  Parameters:
17246  handle - client handle returned by DRV_USART_Open function.
17247  baud - desired baud.
17248  Returns:
17249  None.
17250  Example:
17251  <code>
17252  // myUSARTHandle is the handle returned
17253  // by the DRV_USART_Open function.
17254  DRV_USART_BaudSet(myUSARTHandle, 9600);
17255  </code>
17256  Remarks:
17257  The implementation of this function, in this release of the driver, changes
17258  the baud immediately. This may interrupt on-going data transfer. It is
17259  recommended that the driver be opened exclusively if this function is to be
17260  called. This function is thread safe when used in a RTOS application.
17261 */
17262 
17265  const DRV_HANDLE client ,
17266  uint32_t baud ) ;
17267 // *****************************************************************************
17268 /* Function:
17269  void DRV_USART_LineControlSet
17270  (
17271  DRV_HANDLE client,
17272  DRV_USART_LINE_CONTROL lineControl
17273  );
17274  Summary:
17275  This function changes the USART module line control to the specified value.
17276  <p><b>Implementation:</b> Static/Dynamic</p>
17277  Description:
17278  This function changes the USART module line control parameters to the
17279  specified value. Any queued buffer requests will be processed at the
17280  updated line control parameters. The USART driver operates at the line
17281  control parameters specified in DRV_USART_Initialize function unless the
17282  DRV_USART_LineControlSet function is called to change the line control
17283  parameters.
17284  Precondition:
17285  The DRV_USART_Initialize routine must have been called for the specified
17286  USART driver instance.
17287  DRV_USART_Open must have been called to obtain a valid opened device handle.
17288  Parameters:
17289  handle - client handle returned by DRV_USART_Open function.
17290  lineControl - line control parameters.
17291  Returns:
17292  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17293  DRV_HANDLE_INVALID if the client handle is not valid.
17294  Example:
17295  <code>
17296  // myUSARTHandle is the handle returned
17297  // by the DRV_USART_Open function.
17298  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17299  </code>
17300  Remarks:
17301  The implementation of this function, in this release of the driver, changes
17302  the line control immediately. This may interrupt on-going data transfer. It
17303  is recommended that the driver be opened exclusively if this function is to
17304  be called. This function is thread safe when called in a RTOS application.
17305 */
17306 
17309  const DRV_HANDLE client ,
17310  const DRV_USART_LINE_CONTROL lineControl ) ;
17311 //DOM-IGNORE-BEGIN
17312 //DOM-IGNORE-END
17313  // #ifndef _DRV_USART_H
17314 /*******************************************************************************
17315  End of File
17316 */
17317 
17318 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17319 /* CLOSE_FILE Include File */
17320 
17321 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17322 /*******************************************************************************
17323  USART Driver Variant Mapping
17324  Company:
17325  Microchip Technology Inc.
17326  File Name:
17327  drv_usart_variant_mapping.h
17328  Summary:
17329  USART Driver Variant Mapping
17330  Description:
17331  This file provides feature and build variant mapping macros allowing the
17332  driver to easily be built with different implementation variations based
17333  on static build-time configuration selections.
17334 *******************************************************************************/
17335 //DOM-IGNORE-BEGIN
17336 /*******************************************************************************
17337 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17338 Microchip licenses to you the right to use, modify, copy and distribute
17339 Software only when embedded on a Microchip microcontroller or digital signal
17340 controller that is integrated into your product or third party product
17341 (pursuant to the sublicense terms in the accompanying license agreement).
17342 You should refer to the license agreement accompanying this Software for
17343 additional information regarding your rights and obligations.
17344 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17345 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17346 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17347 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17348 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17349 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17350 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17351 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17352 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17353 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17354 *******************************************************************************/
17355 //DOM-IGNORE-END
17356 #ifndef _DRV_USART_FEATURE_MAPPING_H
17357 #define _DRV_USART_FEATURE_MAPPING_H
17358 // *****************************************************************************
17359 // *****************************************************************************
17360 // Section: Interrrupt Variations
17361 // *****************************************************************************
17362 // *****************************************************************************
17363 /* Mapping of the interrupt mode variations
17364 */
17365  /* Driver is configured for polled mode */
17366 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17367 #define _DRV_USART_InterruptSourceEnable( source )
17368 #define _DRV_USART_InterruptSourceDisable( source ) false
17369 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17370 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17371 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17372 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17373 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17374  /* This means the driver is being built in a baremetal application.
17375  We cannot let a client open the driver in blocking mode */
17376 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17377 // *****************************************************************************
17378 // *****************************************************************************
17379 // Section: Buffer Queue support
17380 // *****************************************************************************
17381 // *****************************************************************************
17382 /* Mapping of macros for buffer queue support
17383 */
17384  /* We dont need buffer queues or byte model support */
17385 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17386 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17387 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17388 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17389 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17390 // *****************************************************************************
17391 // *****************************************************************************
17392 // Initializtion Parameter Static Overrides
17393 // *****************************************************************************
17394 // *****************************************************************************
17395  //_DRV_USART_FEATURE_MAPPING_H
17396 /*******************************************************************************
17397  End of File
17398 */
17399 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17400 /* CLOSE_FILE Include File */
17401 
17402 #include "system/clk/sys_clk.h"
17403 #include "system/int/sys_int.h"
17404 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17405 /*******************************************************************************
17406  Debug System Services Library Header
17407  Company:
17408  Microchip Technology Inc.
17409 
17410  File Name:
17411  sys_debug.h
17412  Summary:
17413  Defines the common debug definitions and interfaces used by MPLAB Harmony
17414  libraries to report errors and debug information to the user.
17415  Description:
17416  This header file defines the common debug definitions and interface macros
17417  (summary below) and prototypes used by MPLAB Harmony libraries to report
17418  errors and debug information to the user.
17419  *******************************************************************************/
17420 //DOM-IGNORE-BEGIN
17421 /*******************************************************************************
17422 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17423 Microchip licenses to you the right to use, modify, copy and distribute
17424 Software only when embedded on a Microchip microcontroller or digital signal
17425 controller that is integrated into your product or third party product
17426 (pursuant to the sublicense terms in the accompanying license agreement).
17427 You should refer to the license agreement accompanying this Software for
17428 additional information regarding your rights and obligations.
17429 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17430 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17431 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17432 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17433 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17434 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17435 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17436 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17437 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17438 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17439  *******************************************************************************/
17440 //DOM-IGNORE-END
17441 #ifndef _SYS_DEBUG_H
17442 #define _SYS_DEBUG_H
17443 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17444  /* LDRA full path */
17445 // This should be defined in system_config.h. It is added here as a build safe-guard.
17446 #define SYS_DEBUG_BUFFER_DMA_READY
17447 // *****************************************************************************
17448 // *****************************************************************************
17449 // Section: SYS DEBUG Data Types
17450 // *****************************************************************************
17451 // *****************************************************************************
17452 // *****************************************************************************
17453 /* SYS_ERROR_LEVEL enumeration
17454  Summary:
17455  System error message priority levels.
17456  Description:
17457  This enumeration defines the supported system error message priority values.
17458  Remarks:
17459  Used by debug message macros to compare individual message priority against
17460  a global system-wide error message priority level to determine if an
17461  individual message should be displayed.
17462 */
17463 
17464 typedef
17465  enum
17466  {
17467  /* Errors that have the potential to cause a system crash. */
17469  /* Errors that have the potential to cause incorrect behavior. */
17471  /* Warnings about potentially unexpected behavior or side effects. */
17473  /* Information helpful to understanding potential errors and warnings. */
17475  /* Verbose information helpful during debugging and testing. */
17477  } SYS_ERROR_LEVEL ;
17478 // DOM-IGNORE-BEGIN
17479 // *****************************************************************************
17480 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17481  SYS_DEBUG_ErrorLevelSet functions to access this value.
17482 */
17483 
17484 extern SYS_ERROR_LEVEL
17485  gblErrLvl ;
17486 // DOM-IGNORE-END
17487 // *****************************************************************************
17488 /* SYS Debug Module Index Number
17489  Summary:
17490  Debug System Service index.
17491  Description:
17492  This constant defines a symbolic name for the debug system service index.
17493  Remarks:
17494  There can only be a single debug system service instance in the system.
17495 */
17496 #define SYS_DEBUG_INDEX_0 0
17497 // *****************************************************************************
17498 /* SYS Debug Initialize structure
17499  Summary:
17500  Defines the data required to initialize the debug system service.
17501  Description:
17502  This structure defines the data required to initialize the debug system
17503  service.
17504  Remarks:
17505  None.
17506 */
17507 
17508 typedef
17509  struct
17510  {
17511  /* System module initialization */
17512  SYS_MODULE_INIT moduleInit ;
17513  /* Initial system error level setting. */
17514  SYS_ERROR_LEVEL errorLevel ;
17515  /* Console index to receive debug messages */
17516  SYS_MODULE_INDEX consoleIndex ;
17517  } SYS_DEBUG_INIT ;
17518 // *****************************************************************************
17519 // *****************************************************************************
17520 // Section: SYS DEBUG Functions
17521 // *****************************************************************************
17522 // *****************************************************************************
17523 // *****************************************************************************
17524 /* Function:
17525  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17526  const SYS_MODULE_INIT * const init )
17527  Summary:
17528  Initializes the global error level and specific module instance.
17529  Description:
17530  This function initializes the global error level. It also initializes any
17531  internal system debug module data structures.
17532  Precondition:
17533  None.
17534  Parameters:
17535  index - Index for the instance to be initialized
17536  init - Pointer to a data structure containing any data necessary
17537  to initialize the debug service. This pointer may be null
17538  if no data is required because static overrides have
17539  been provided.
17540  Returns:
17541  If successful, returns a valid handle to an object. Otherwise, it
17542  returns SYS_MODULE_OBJ_INVALID.
17543  Example:
17544  <code>
17545  SYS_MODULE_OBJ objectHandle;
17546  SYS_DEBUG_INIT debugInit =
17547  {
17548  .moduleInit = {0},
17549  .errorLevel = SYS_ERROR_DEBUG,
17550  };
17551  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17552  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17553  {
17554  // Handle error
17555  }
17556  </code>
17557  Remarks:
17558  This routine should only be called once during system initialization. If the
17559  system was already initialized it safely returns without causing any disturbance.
17560 */
17561 
17562 SYS_MODULE_OBJ
17564  const SYS_MODULE_INDEX index ,
17565  const SYS_MODULE_INIT * const init ) ;
17566 // *****************************************************************************
17567 /* Function:
17568  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17569  const SYS_MODULE_INIT * const init )
17570  Summary:
17571  Reinitializes and refreshes the data structure for the instance of the
17572  Debug module.
17573  Description:
17574  This function reinitializes and refreshes the data structure for the instance
17575  of the Debug module using the supplied data.
17576  Precondition:
17577  The SYS_DEBUG_Initialize function should have been called before calling
17578  this function.
17579  Parameters:
17580  object - Identifies the SYS DEBUG Object returned by the Initialize
17581  interface
17582  init - Pointer to the data structure containing any data
17583  necessary to initialize the hardware
17584  Returns:
17585  None
17586  Example:
17587  <code>
17588  SYS_MODULE_OBJ objectHandle;
17589  // Populate the console initialization structure
17590  SYS_DEBUG_INIT dbgInit =
17591  {
17592  .moduleInit = {0},
17593  .errorLevel = SYS_ERROR_DEBUG,
17594  };
17595  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17596  </code>
17597  Remarks:
17598  This operation uses the same initialization data structure as the
17599  SYS_DEBUG_Initialize operation. This function can be called multiple times
17600  to reinitialize the module.
17601 */
17602 
17603 void
17605  SYS_MODULE_OBJ object ,
17606  const SYS_MODULE_INIT * const init ) ;
17607 // *****************************************************************************
17608 /* Function:
17609  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17610  Summary:
17611  Deinitializes the specific module instance of the Debug module.
17612  Description:
17613  This function deinitializes the specific module instance disabling its
17614  operation (and any hardware for driver modules). Resets all of the internal
17615  data structures and fields for the specified instance to the default settings.
17616  Precondition:
17617  The SYS_DEBUG_Initialize function should have been called before calling
17618  this function.
17619  Parameters:
17620  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17621  Returns:
17622  None.
17623  Example:
17624  <code>
17625  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17626  SYS_DEBUG_Deinitialize (object);
17627  </code>
17628  Remarks:
17629  Once the Initialize operation has been called, the Deinitialize
17630  operation must be called before the Initialize operation can be called
17631  again.
17632 */
17633 
17634 void
17636  SYS_MODULE_OBJ object ) ;
17637 // *****************************************************************************
17638 /* Function:
17639  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17640  Summary:
17641  Maintains the debug module's state machine.
17642  Description:
17643  This function is used to maintain the debug module's internal state
17644  machine and implement its ISR for interrupt-driven implementations.
17645  Precondition:
17646  The SYS_DEBUG_Initialize function must have been called for the specified
17647  CONSOLE driver instance.
17648  Parameters:
17649  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17650  Returns:
17651  None.
17652  Example:
17653  <code>
17654  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17655  while (true)
17656  {
17657  SYS_DEBUG_Tasks (object);
17658  // Do other tasks
17659  }
17660  </code>
17661  Remarks:
17662  This function is normally not called directly by an application. It is
17663  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17664  ISR.
17665 */
17666 
17667 void
17668  SYS_DEBUG_Tasks (
17669  SYS_MODULE_OBJ object ) ;
17670 // *****************************************************************************
17671 /* Function:
17672  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17673  Summary:
17674  Returns status of the specific instance of the debug service module.
17675  Description:
17676  This function returns the status of the specific debug service module
17677  instance.
17678  Precondition:
17679  The SYS_CONSOLE_Initialize function should have been called before calling
17680  this function.
17681  Parameters:
17682  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17683  Returns:
17684  * SYS_STATUS_READY - Indicates that the module is running and
17685  ready to service requests. Any value greater
17686  than SYS_STATUS_READY is also a normal
17687  running state in which the module is ready
17688  to accept new operations.
17689  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17690  previous system level operation and cannot
17691  start another.
17692  * SYS_STATUS_ERROR - Indicates that the module is in an error
17693  state. Any value less than SYS_STATUS_ERROR
17694  is also an error state.
17695  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17696  initialized or has been deinitialized.
17697  Example:
17698  <code>
17699  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17700  SYS_STATUS debugStatus;
17701  debugStatus = SYS_DEBUG_Status (object);
17702  if (SYS_STATUS_ERROR >= debugStatus)
17703  {
17704  // Handle error
17705  }
17706  </code>
17707  Remarks:
17708  None.
17709 */
17710 
17711 SYS_STATUS
17713  SYS_MODULE_OBJ object ) ;
17714 // *****************************************************************************
17715 // *****************************************************************************
17716 // Section: SYS DEBUG Console Functions
17717 // *****************************************************************************
17718 // *****************************************************************************
17719 // *****************************************************************************
17720 /* Function:
17721  SYS_DEBUG_Message( const char* message );
17722  Summary:
17723  Prints a message to the console regardless of the system error level.
17724  Description:
17725  This function prints a message to the console regardless of the system
17726  error level. It can be used as an implementation of the SYS_MESSAGE and
17727  SYS_DEBUG_MESSAGE macros.
17728  Precondition:
17729  SYS_DEBUG_Initialize must have returned a valid object handle and the
17730  SYS_DEBUG_Tasks function must be called by the system to complete the
17731  message request.
17732  Parameters:
17733  message - Pointer to a message string to be displayed.
17734  Returns:
17735  None.
17736  Example:
17737  <code>
17738  // In system_config.h:
17739 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17740 
17741  // In source (.c) files:
17742  SYS_MESSAGE("My Message\n\r");
17743  </code>
17744  Remarks:
17745  Do not call this function directly. Call the SYS_MESSAGE or
17746  SYS_DEBUG_MESSAGE macros instead.
17747 
17748  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17749  the messages and message function calls from the source code. To access
17750  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17751  override the definitions of the individual macros.
17752 */
17753 
17754 void
17756  const char * message ) ;
17757 // *****************************************************************************
17758 /* Function:
17759  SYS_DEBUG_Print( const char* format, ... )
17760  Summary:
17761  Formats and prints a message with a variable number of arguments to the
17762  console regardless of the system error level.
17763  Description:
17764  This function formats and prints a message with a variable number of
17765  arguments to the console regardless of the system error level. It can be
17766  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17767  Precondition:
17768  SYS_DEBUG_Initialize must have returned a valid object handle and the
17769  SYS_DEBUG_Tasks function must be called by the system to complete the
17770  message request.
17771  Parameters:
17772  format - Pointer to a buffer containing the format string for
17773  the message to be displayed.
17774  ... - Zero or more optional parameters to be formated as
17775  defined by the format string.
17776  Returns:
17777  None.
17778  Example:
17779  <code>
17780  // In system_config.h
17781 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17782 
17783  // In source code
17784  int result;
17785 
17786  result = SomeOperation();
17787  if (result > MAX_VALUE)
17788  {
17789  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17790  }
17791  </code>
17792  Remarks:
17793  The format string and arguments follow the printf convention.
17794 
17795  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17796  macros instead.
17797 
17798  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17799  messages and message function calls. To access and utilize the messages,
17800  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17801  individual macros.
17802 */
17803 
17804 void
17805  SYS_DEBUG_Print (
17806  const char * format ,
17807  ... ) ;
17808 // *****************************************************************************
17809 /* Function:
17810  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17811  Summary:
17812  Sets the global system error reporting level.
17813  Description:
17814  This function sets the global system error reporting level.
17815 
17816  Precondition:
17817  SYS_DEBUG_Initialize must have returned a valid object handle.
17818  Parameters:
17819  level - The desired system error level.
17820  Returns:
17821  None.
17822  Example:
17823  <code>
17824  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17825  </code>
17826  Remarks:
17827  None.
17828 */
17829 
17830 void
17832  SYS_ERROR_LEVEL level ) ;
17833 // *****************************************************************************
17834 /* Function:
17835  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17836  Summary:
17837  Returns the global system Error reporting level.
17838  Description:
17839  This function returns the global System Error reporting level.
17840 
17841  Precondition:
17842  SYS_DEBUG_Initialize must have returned a valid object handle.
17843  Parameters:
17844  None.
17845  Returns:
17846  The global System Error Level.
17847  Example:
17848  <code>
17849  SYS_ERROR_LEVEL level;
17850 
17851  level = SYS_DEBUG_ErrorLevelGet();
17852  </code>
17853  Remarks:
17854  None.
17855 */
17856 
17858  SYS_DEBUG_ErrorLevelGet ( void ) ;
17859 // *****************************************************************************
17860 // *****************************************************************************
17861 // Section: SYS DEBUG Macros
17862 // *****************************************************************************
17863 // *****************************************************************************
17864 // *****************************************************************************
17865 /* Macro:
17866  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17867  Summary:
17868  Prints a debug message if the specified level is at or below the global
17869  system error level.
17870  Description:
17871  This macro prints a debug message if the specified level is at or below the
17872  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17873  Precondition:
17874  SYS_DEBUG_Initialize must have returned a valid object handle.
17875  Parameters:
17876  level - The current error level threshold for displaying the message.
17877  message - Pointer to a buffer containing the message to be displayed.
17878  Returns:
17879  None.
17880  Example:
17881  <code>
17882  // In system_config.h
17883 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17884 
17885  // In library source (.c) code.
17886  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17887  </code>
17888  Remarks:
17889  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17890 
17891  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17892  function call from the source code. To access and utilize the message,
17893  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17894  SYS_DEBUG_MESSAGE macro.
17895 */
17896 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17897 // *****************************************************************************
17898 /* Macro:
17899  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17900  Summary:
17901  Formats and prints a debug message if the specified level is at or below the
17902  global system error level.
17903  Description:
17904  This function formats and prints a debug message if the specified level is
17905  at or below the global system error level. It can be used to implement the
17906  SYS_DEBUG_PRINT macro.
17907  Precondition:
17908  SYS_DEBUG_Initialize must have returned a valid object handle.
17909  Parameters:
17910  level - The current error level threshold for displaying the message.
17911  format - Pointer to a buffer containing the format string for
17912  the message to be displayed.
17913  ... - Zero or more optional parameters to be formated as
17914  defined by the format string.
17915  Returns:
17916  None.
17917  Example:
17918  <code>
17919  // In system_config.h
17920 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17921 
17922  // In source code
17923  int result;
17924 
17925  result = SomeOperation();
17926  if (result > MAX_VALUE)
17927  {
17928  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17929  // Take appropriate action
17930  }
17931  </code>
17932  Remarks:
17933  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17934 
17935  The default SYS_DEBUG_PRINT macro definition removes the message and
17936  function call from the source code. To access and utilize the message,
17937  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17938  SYS_DEBUG_PRINT macro.
17939 */
17940 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17941 // DOM-IGNORE-BEGIN
17942 // *****************************************************************************
17943 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17944  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17945  (system_config.h) will map the macros below to the appropriate system
17946  console functions.
17947 */
17948 // DOM-IGNORE-END
17949 // *****************************************************************************
17950 /* Macro:
17951  SYS_MESSAGE( const char* message )
17952  Summary:
17953  Prints a message to the console regardless of the system error level.
17954  Description:
17955  This macro is used to print a message to the console regardless of the
17956  system error level. It can be mapped to any desired implementation.
17957  Precondition:
17958  If mapped to the _SYS_MESSAGE function, then the system debug service must
17959  be initialized and running.
17960  Parameters:
17961  message - Pointer to a buffer containing the message string to be
17962  displayed.
17963  Returns:
17964  None.
17965  Example:
17966  <code>
17967  // In system_config.h:
17968 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17969 
17970  // In source (.c) files:
17971  SYS_MESSAGE("My Message\n\r");
17972  </code>
17973  Remarks:
17974  By default, this macro is defined as nothing, effectively removing all code
17975  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17976  defined in a way that maps calls to it to the desired implementation (see
17977  example, above).
17978 
17979  This macro can be mapped to the system console service (along with other
17980  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17981  configuration (system_config.h) instead of defining it individually.
17982 */
17983 #define SYS_MESSAGE( message )
17984 // *****************************************************************************
17985 /* Function:
17986  SYS_DEBUG_MESSAGE( const char* message )
17987  Summary:
17988  Prints a debug message if the system error level is defined defined at
17989  or lower than the level specified.
17990  Description:
17991  This function prints a debug message if the system error level is defined at
17992  or lower than the level specified.
17993  Precondition:
17994  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17995  Parameters:
17996  level - The current error level threshold for displaying the message.
17997  message - Pointer to a buffer containing the message to be displayed.
17998  Returns:
17999  None.
18000  Example:
18001  <code>
18002 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
18003  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
18004  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18005  </code>
18006  Remarks:
18007  By default, this macro is defined as nothing, effectively removing all code
18008  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18009  must be defined in a way that maps calls to it to the desired implementation
18010  (see example, above).
18011 
18012  This macro can be mapped to the system console service (along with other
18013  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18014  configuration (system_config.h) instead of defining it individually.
18015 */
18016 #define SYS_DEBUG_MESSAGE( level , message )
18017 // *****************************************************************************
18018 /* Function:
18019  SYS_PRINT(const char* format, ...);
18020  Summary:
18021  Formats and prints an error message with a variable number of arguments
18022  regardless of the system error level.
18023  Description:
18024  This function formats and prints an error message with a variable number of
18025  if the system error level is defined at or lower than the level specified.
18026  Precondition:
18027  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18028  Parameters:
18029  format - Pointer to a buffer containing the format string for
18030  the message to be displayed.
18031  ... - Zero or more optional parameters to be formated as
18032  defined by the format string.
18033  Returns:
18034  None.
18035  Example:
18036  <code>
18037  // In system_config.h
18038 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18039 
18040  // In source code
18041  int result;
18042 
18043  result = SomeOperation();
18044  if (result > MAX_VALUE)
18045  {
18046  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18047  // Take appropriate action
18048  }
18049  </code>
18050  Remarks:
18051  The format string and arguments follow the printf convention. This function
18052  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18053 
18054  By default, this macro is defined as nothing, effectively removing all code
18055  generated by calls to it. To process SYS_PRINT calls, this macro must be
18056  defined in a way that maps calls to it to the desired implementation (see
18057  example, above).
18058 
18059  This macro can be mapped to the system console service (along with other
18060  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18061  configuration (system_config.h) instead of defining it individually.
18062 */
18063 #define SYS_PRINT( fmt ,... )
18064 // *****************************************************************************
18065 /* Macro:
18066  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18067  Summary:
18068  Formats and prints an error message if the system error level is defined at
18069  or lower than the level specified.
18070  Description:
18071  This macro formats and prints an error message if the system error level
18072  is defined at or lower than the level specified.o
18073  Precondition:
18074  SYS_DEBUG_Initialize must have returned a valid object handle.
18075  Parameters:
18076  level - The current error level threshold for displaying the message.
18077  format - Pointer to a buffer containing the format string for
18078  the message to be displayed.
18079  ... - Zero or more optional parameters to be formated as
18080  defined by the format string.
18081  Returns:
18082  None.
18083  Example:
18084  <code>
18085  // In system_config.h
18086 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18087 
18088  // In source code
18089  int result;
18090 
18091  result = SomeOperation();
18092  if (result > MAX_VALUE)
18093  {
18094  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18095  // Take appropriate action
18096  }
18097  </code>
18098  Remarks:
18099  The format string and arguments follow the printf convention. This function
18100  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18101 
18102  By default, this macro is defined as nothing, effectively removing all code
18103  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18104  defined in a way that maps calls to it to the desired implementation (see
18105  example, above).
18106 
18107  This macro can be mapped to the system console service (along with other
18108  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18109  configuration (system_config.h) instead of defining it individually.
18110 */
18111 #define SYS_DEBUG_PRINT( level , fmt ,... )
18112 // *****************************************************************************
18113 /* Macro:
18114  SYS_DEBUG_BreakPoint( void )
18115  Summary:
18116  Inserts a software breakpoint instruction when building in Debug mode.
18117  Description:
18118  This macro inserts a software breakpoint instruction when building in Debug
18119  mode.
18120  Precondition:
18121  None.
18122  Parameters:
18123  None.
18124  Returns:
18125  None.
18126  Example:
18127  <code>
18128  if (myDebugTestFailed)
18129  {
18130  SYS_DEBUG_BreakPoint();
18131  }
18132  </code>
18133  Remarks:
18134  Compiles out if not built for debugging.
18135 */
18136 #define SYS_DEBUG_BreakPoint( )
18137 // *****************************************************************************
18138 // *****************************************************************************
18139 // Section: SYS DEBUG Deprecated Macros
18140 // *****************************************************************************
18141 // *****************************************************************************
18142 /* Do not use these macros for new development.
18143 */
18144 //DOM-IGNORE-BEGIN
18145 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18146 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18147 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18148 //DOM-IGNORE-END
18149  // _SYS_DEBUG_H
18150 /*******************************************************************************
18151  End of File
18152 */
18153 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18154 /* CLOSE_FILE Include File */
18155 
18156 // DOM-IGNORE-BEGIN
18157 // DOM-IGNORE-END
18158 // *****************************************************************************
18159 // *****************************************************************************
18160 // Section: Data Type Definitions
18161 // *****************************************************************************
18162 // *****************************************************************************
18163 /* USART FIFO+RX(8+1) size */
18164 #define _DRV_USART_RX_DEPTH 9
18165 // *****************************************************************************
18166 /* USART Static Driver Instance Object
18167  Summary:
18168  Object used to keep any data required for the static USART driver.
18169  Description:
18170  This object is used to keep track of any data that must be maintained to
18171  manage the USART static driver.
18172  Remarks:
18173  None.
18174 */
18175 
18176 typedef
18177  struct
18178  {
18179  /* Client specific error */
18180  DRV_USART_ERROR error ;
18181  } DRV_USART_OBJ ;
18182 // *****************************************************************************
18183 // *****************************************************************************
18184 // Section: Local functions.
18185 // *****************************************************************************
18186 // *****************************************************************************
18187 // DOM-IGNORE-BEGIN
18188 // DOM-IGNORE-END
18189  //#ifndef _DRV_USART_STATIC_LOCAL_H
18190 /*******************************************************************************
18191  End of File
18192 */
18193 
18194 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18195 /* CLOSE_FILE Include File */
18196 
18197 // DOM-IGNORE-BEGIN
18198 // DOM-IGNORE-END
18199 // *********************************************************************************************
18200 // *********************************************************************************************
18201 // Section: System Interface Headers for the Instance 0 of USART static driver
18202 // *********************************************************************************************
18203 // *********************************************************************************************
18204 
18205 SYS_MODULE_OBJ
18206  DRV_USART0_Initialize ( void ) ;
18207 
18208 void
18209  DRV_USART0_Deinitialize ( void ) ;
18210 
18211 SYS_STATUS
18212  DRV_USART0_Status ( void ) ;
18213 
18214 void
18215  DRV_USART0_TasksTransmit ( void ) ;
18216 
18217 void
18218  DRV_USART0_TasksReceive ( void ) ;
18219 
18220 void
18221  DRV_USART0_TasksError ( void ) ;
18222 // *********************************************************************************************
18223 // *********************************************************************************************
18224 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18225 // *********************************************************************************************
18226 // *********************************************************************************************
18227 
18228 DRV_HANDLE
18229  DRV_USART0_Open (
18230  const SYS_MODULE_INDEX index ,
18231  const DRV_IO_INTENT ioIntent ) ;
18232 
18233 void
18234  DRV_USART0_Close ( void ) ;
18235 
18237  DRV_USART0_ClientStatus ( void ) ;
18238 
18240  DRV_USART0_TransferStatus ( void ) ;
18241 
18243  DRV_USART0_ErrorGet ( void ) ;
18244 // *********************************************************************************************
18245 // *********************************************************************************************
18246 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18247 // *********************************************************************************************
18248 // *********************************************************************************************
18249 
18250 uint8_t
18251  DRV_USART0_ReadByte ( void ) ;
18252 
18253 void
18255  const uint8_t byte ) ;
18256 
18257 unsigned int
18259 
18260 unsigned int
18262 
18263 bool
18265 
18266 bool
18268 // *********************************************************************************************
18269 // *********************************************************************************************
18270 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18271 // *********************************************************************************************
18272 // *********************************************************************************************
18273 
18276  uint32_t baud ) ;
18277 
18280  DRV_USART_LINE_CONTROL lineControlMode ) ;
18281 // DOM-IGNORE-BEGIN
18282 // DOM-IGNORE-END
18283  // #ifndef _DRV_USART_STATIC_H
18284 /*******************************************************************************
18285  End of File
18286 */
18287 
18288 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18289 /* CLOSE_FILE Include File */
18290 
18291 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18292 /*******************************************************************************
18293  Ports System Service Interface Definition
18294  Company:
18295  Microchip Technology Inc.
18296  File Name:
18297  sys_ports.h
18298  Summary:
18299  Ports System Service interface definitions
18300  Description:
18301  This file contains the interface definition for the Ports system
18302  service. It provides a way to interact with the Ports subsystem to
18303  manage the timing requests supported by the system
18304 *******************************************************************************/
18305 //DOM-IGNORE-BEGIN
18306 /*******************************************************************************
18307 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18308 Microchip licenses to you the right to use, modify, copy and distribute
18309 Software only when embedded on a Microchip microcontroller or digital signal
18310 controller that is integrated into your product or third party product
18311 (pursuant to the sublicense terms in the accompanying license agreement).
18312 You should refer to the license agreement accompanying this Software for
18313 additional information regarding your rights and obligations.
18314 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18315 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18316 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18317 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18318 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18319 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18320 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18321 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18322 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18323 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18324 *******************************************************************************/
18325 //DOM-IGNORE-END
18326 #ifndef _SYS_PORTS_H
18327 #define _SYS_PORTS_H
18328 // *****************************************************************************
18329 // *****************************************************************************
18330 // Section: Included Files
18331 // *****************************************************************************
18332 // *****************************************************************************
18333 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18334 /*******************************************************************************
18335  PORTS System Service Library Interface Definition
18336  Company:
18337  Microchip Technology Inc.
18338  File Name:
18339  sys_ports_definitions.h
18340  Summary:
18341  PORTS System Service data type definitions header.
18342  Description:
18343  This file contains data type definitions header.
18344 *******************************************************************************/
18345 //DOM-IGNORE-BEGIN
18346 /*******************************************************************************
18347 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18348 Microchip licenses to you the right to use, modify, copy and distribute
18349 Software only when embedded on a Microchip microcontroller or digital signal
18350 controller that is integrated into your product or third party product
18351 (pursuant to the sublicense terms in the accompanying license agreement).
18352 You should refer to the license agreement accompanying this Software for
18353 additional information regarding your rights and obligations.
18354 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18355 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18356 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18357 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18358 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18359 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18360 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18361 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18362 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18363 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18364 *******************************************************************************/
18365 //DOM-IGNORE-END
18366 #ifndef _SYS_PORTS_DEFINITIONS_H
18367 #define _SYS_PORTS_DEFINITIONS_H
18368 // *****************************************************************************
18369 // *****************************************************************************
18370 // Section: File includes
18371 // *****************************************************************************
18372 // *****************************************************************************
18373 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18374 #include "system/common/sys_common.h"
18375 #include "system/common/sys_module.h"
18376 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18377 /*******************************************************************************
18378  Ports Peripheral Library Interface Header
18379  Company:
18380  Microchip Technology Inc.
18381  File Name:
18382  plib_ports.h
18383  Summary:
18384  Ports Peripheral Library Interface header for Ports function definitions.
18385  Description:
18386  This header file contains the function prototypes and definitions of
18387  the data types and constants that make up the interface to the Ports
18388  Peripheral Library for all families of Microchip microcontrollers. The
18389  definitions in this file are common to the Ports peripheral.
18390 *******************************************************************************/
18391 // DOM-IGNORE-BEGIN
18392 /*******************************************************************************
18393 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18394 Microchip licenses to you the right to use, modify, copy and distribute
18395 Software only when embedded on a Microchip microcontroller or digital signal
18396 controller that is integrated into your product or third party product
18397 (pursuant to the sublicense terms in the accompanying license agreement).
18398 You should refer to the license agreement accompanying this Software for
18399 additional information regarding your rights and obligations.
18400 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18401 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18402 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18403 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18404 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18405 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18406 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18407 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18408 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18409 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18410 *******************************************************************************/
18411 // DOM-IGNORE-END
18412 #ifndef _PLIB_PORTS_H
18413 #define _PLIB_PORTS_H
18414 #include <stdint.h>
18415 #include <stddef.h>
18416 // DOM-IGNORE-BEGIN
18417 // DOM-IGNORE-END
18418 // *****************************************************************************
18419 // *****************************************************************************
18420 // Section: Constants & Data Types
18421 // *****************************************************************************
18422 // *****************************************************************************
18423 // *****************************************************************************
18424 /* Ports data mask definition
18425  Summary:
18426  Data type defining the Ports data mask
18427  Description:
18428  This data type defines the Ports data mask
18429  Remarks:
18430  None.
18431 */
18432 
18433 typedef
18434 uint16_t
18436 // *****************************************************************************
18437 /* Ports data type definition
18438  Summary:
18439  Data type defining the Ports data type.
18440  Description:
18441  This data type defines the Ports data type.
18442  Remarks:
18443  None.
18444 */
18445 
18446 typedef
18447 uint32_t
18449 // *****************************************************************************
18450 // *****************************************************************************
18451 // Section: Included Files (continued at end of file)
18452 // *****************************************************************************
18453 // *****************************************************************************
18454 /* This section lists the other files that are included in this file. However,
18455  please see the end of the file for additional implementation header files
18456  that are also included.
18457 */
18458 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18459 //DOM-IGNORE-BEGIN
18460 /*******************************************************************************
18461 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18462 Microchip licenses to you the right to use, modify, copy and distribute
18463 Software only when embedded on a Microchip microcontroller or digital signal
18464 controller that is integrated into your product or third party product
18465 (pursuant to the sublicense terms in the accompanying license agreement).
18466 You should refer to the license agreement accompanying this Software for
18467 additional information regarding your rights and obligations.
18468 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18469 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18470 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18471 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18472 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18473 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18474 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18475 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18476 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18477 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18478  *******************************************************************************/
18479 //DOM-IGNORE-END
18480 #ifndef _PLIB_PORTS_PROCESSOR_H
18481 #define _PLIB_PORTS_PROCESSOR_H
18482 #error "Can't find header"
18483 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18484 /* CLOSE_FILE Include File */
18485 
18486 // *****************************************************************************
18487 // *****************************************************************************
18488 // Section: Ports Peripheral Library Interface Routines
18489 // *****************************************************************************
18490 // *****************************************************************************
18491 // *****************************************************************************
18492 /* Function:
18493  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18494  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18495  PORTS_REMAP_INPUT_PIN remapInputPin );
18496  Summary:
18497  Input function remapping.
18498  Description:
18499  This function controls the Input function remapping. It allows user to map
18500  any of the input functionality on any of the remappable input pin.
18501  This function does not perform atomic register access.
18502  Precondition:
18503  IOLOCK bit of configuration register should be clear to allow any remapping.
18504  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18505  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18506  find more information.
18507  Parameters:
18508  index - Identifier for the device instance to be configured
18509  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18510  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18511  Returns:
18512  None.
18513  Example:
18514  <code>
18515 
18516  // System Unlock
18517  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18518  // Unlock PPS registers
18519  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18520  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18521  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18522  </code>
18523  Remarks:
18524  This feature may not be available on all devices. Please refer to the
18525  specific device data sheet to determine availability or use
18526  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18527  this feature is available.
18528 */
18529 
18530 void
18532  PORTS_MODULE_ID index ,
18533  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18534  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18535 // *****************************************************************************
18536 /* Function:
18537  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18538  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18539  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18540  Summary:
18541  Output function remapping.
18542  Description:
18543  This function controls the Output function remapping. it allows user to map
18544  any of the output functionality on any of the remappable output pin.
18545  This function does not perform atomic register access.
18546  Precondition:
18547  IOLOCK bit of configuration register should be clear to allow any remapping.
18548  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18549  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18550  find more information.
18551  Parameters:
18552  index - Identifier for the device instance to be configured
18553  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18554  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18555  Returns:
18556  None.
18557  Example:
18558  <code>
18559 
18560  // System Unlock
18561  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18562  // Unlock PPS registers
18563  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18564  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18565  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18566 
18567  </code>
18568  Remarks:
18569  This feature may not be available on all devices. Please refer to the
18570  specific device data sheet to determine availability or use
18571  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18572  this feature is available.
18573 */
18574 
18575 void
18577  PORTS_MODULE_ID index ,
18578  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18579  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18580 // *****************************************************************************
18581 /* Function:
18582  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18583  PORTS_ANALOG_PIN pin,
18584  PORTS_PIN_MODE mode );
18585  Summary:
18586  Enables the selected pin as analog or digital.
18587  Description:
18588  This function enables the selected pin as analog or digital.
18589  This function does not perform atomic register access.
18590  Precondition:
18591  None.
18592  Parameters:
18593  index - Identifier for the device instance to be configured
18594  pin - Possible values of PORTS_ANALOG_PIN
18595  mode - Possible values of PORTS_PIN_MODE
18596  Returns:
18597  None.
18598  Example:
18599  <code>
18600 
18601  // Make AN0 pin as Analog
18602  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18603 
18604  </code>
18605  Remarks:
18606  This feature may not be available on all devices. Please refer to the
18607  specific device data sheet to determine availability or use
18608  PLIB_PORTS_ExistsPinMode in your application to determine whether
18609  this feature is available.
18610 */
18611 
18612 void
18614  PORTS_MODULE_ID index ,
18615  PORTS_ANALOG_PIN pin ,
18616  PORTS_PIN_MODE mode ) ;
18617 // *****************************************************************************
18618 /* Function:
18619  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18620  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18621  PORTS_PIN_MODE mode );
18622  Summary:
18623  Enables the selected port pin as analog or digital.
18624  Description:
18625  This function enables the selected port pin as analog or digital.
18626  This function does not perform atomic register access.
18627  Precondition:
18628  None.
18629  Parameters:
18630  index - Identifier for the device instance to be configured
18631  channel - Port pin channel
18632  bitPos - Position in the PORT pins
18633  mode - Possible values of PORTS_PIN_MODE
18634  Returns:
18635  None.
18636  Example:
18637  <code>
18638 
18639  // Make RC5 pin Analog
18640  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18641  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18642 
18643  </code>
18644  Remarks:
18645  This function is only available in devices with PPS. For Non-PPS devices, use the
18646  PLIB_PORTS_PinModeSelect function.
18647 
18648  This feature may not be available on all devices. Please refer to the
18649  specific device data sheet to determine availability or use
18650  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18651  this feature is available.
18652 */
18653 
18654 void
18656  PORTS_MODULE_ID index ,
18657  PORTS_CHANNEL channel ,
18658  PORTS_BIT_POS bitPos ,
18659  PORTS_PIN_MODE mode ) ;
18660 // *****************************************************************************
18661 /* Function:
18662  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18663  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18664  Summary:
18665  Enables the pull-down for selected Change Notice pins.
18666  Description:
18667  This function enables the pull-down for selected Change Notice pins.
18668  This function does not perform atomic register access.
18669  Precondition:
18670  None.
18671  Parameters:
18672  index - Identifier for the device instance to be configured
18673  channel - Port pin channel
18674  bitPos - Position in the PORT pins
18675  Returns:
18676  None.
18677  Example:
18678  <code>
18679 
18680  // Enable pull-down for RC5 pin
18681  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18682  PORTS_BIT_POS_5);
18683 
18684  </code>
18685  Remarks:
18686  This feature may not be available on all devices. Please refer to the
18687  specific device data sheet to determine availability or use
18688  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18689  determine whether this feature is available.
18690 */
18691 
18692 void
18694  PORTS_MODULE_ID index ,
18695  PORTS_CHANNEL channel ,
18696  PORTS_BIT_POS bitPos ) ;
18697 // *****************************************************************************
18698 /* Function:
18699  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18700  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18701  Summary:
18702  Disables the pull-down for selected Change Notice pins.
18703  Description:
18704  This function disables the pull-down for selected Change Notice pins.
18705  This function does not perform atomic register access.
18706  Precondition:
18707  None.
18708  Parameters:
18709  index - Identifier for the device instance to be configured
18710  channel - Port pin channel
18711  bitPos - Position in the PORT pins
18712  Returns:
18713  None.
18714  Example:
18715  <code>
18716 
18717  // Disable pull-down for RC5 pin
18718  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18719  PORTS_BIT_POS_5);
18720  </code>
18721  Remarks:
18722  This feature may not be available on all devices. Please refer to the
18723  specific device data sheet to determine availability or use
18724  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18725  determine whether this feature is available.
18726 */
18727 
18728 void
18730  PORTS_MODULE_ID index ,
18731  PORTS_CHANNEL channel ,
18732  PORTS_BIT_POS bitPos ) ;
18733 // *****************************************************************************
18734 /* Function:
18735  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18736  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18737  Summary:
18738  Enables the pull-up for selected Change Notice pins.
18739  Description:
18740  This function enables the pull-up for selected Change Notice pins.
18741  This function does not perform atomic register access.
18742  Precondition:
18743  None.
18744  Parameters:
18745  index - Identifier for the device instance to be configured
18746  channel - Port pin channel
18747  bitPos - Position in the PORT pins
18748  Returns:
18749  None.
18750  Example:
18751  <code>
18752 
18753  // Enable pull-up for RC5 pin
18754  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18755  PORTS_BIT_POS_5);
18756  </code>
18757  Remarks:
18758  This function is only available in devices with PPS. For Non-PPS devices, use the
18759  PLIB_PORTS_ChangeNoticePullUpEnable function.
18760 
18761  This feature may not be available on all devices. Please refer to the
18762  specific device data sheet to determine availability or use
18763  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18764  determine whether this feature is available.
18765 */
18766 
18767 void
18769  PORTS_MODULE_ID index ,
18770  PORTS_CHANNEL channel ,
18771  PORTS_BIT_POS bitPos ) ;
18772 // *****************************************************************************
18773 /* Function:
18774  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18775  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18776  Summary:
18777  Disables weak pull-up for the selected pin.
18778  Description:
18779  This function disables weak pull-up for the selected port pin.
18780  This function does not perform atomic register access.
18781  Precondition:
18782  None.
18783  Parameters:
18784  index - Identifier for the device instance to be configured
18785  channel - Port pin channel
18786  bitPos - Position in the PORT pins
18787  Returns:
18788  None.
18789  Example:
18790  <code>
18791 
18792  // Disable pull-up for RC5 pin
18793  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18794  PORTS_BIT_POS_5);
18795 
18796  </code>
18797  Remarks:
18798  This function is only available in devices with PPS. For Non-PPS devices, use the
18799  PLIB_PORTS_ChangeNoticePullUpDisable function.
18800 
18801  Pull-ups on change notification pins should always be disabled when the
18802  port pin is configured as a digital output.
18803 
18804  This feature may not be available on all devices. Please refer to the
18805  specific device data sheet to determine availability or use
18806  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18807  determine whether this feature is available.
18808 */
18809 
18810 void
18812  PORTS_MODULE_ID index ,
18813  PORTS_CHANNEL channel ,
18814  PORTS_BIT_POS bitPos ) ;
18815 // *****************************************************************************
18816 /* Function:
18817  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18818  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18819  Summary:
18820  Enables CN interrupt for the selected pin.
18821  Description:
18822  This function enables Change Notice interrupt for the selected port pin.
18823  This function does not perform atomic register access.
18824 
18825  Precondition:
18826  None.
18827  Parameters:
18828  index - Identifier for the device instance to be configured
18829  channel - Port pin channel
18830  bitPos - Position in the PORT pins
18831  Returns:
18832  None.
18833  Example:
18834  <code>
18835 
18836  // Enable CN interrupt for RC5 pin
18837  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18838  PORTS_BIT_POS_5);
18839 
18840  </code>
18841  Remarks:
18842  This function is only available in devices with PPS. For Non-PPS devices, use the
18843  PLIB_PORTS_PinChangeNoticeEnable function.
18844 
18845  This feature may not be available on all devices. Please refer to the
18846  specific device data sheet to determine availability or use
18847  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18848  determine whether this feature is available.
18849 */
18850 
18851 void
18853  PORTS_MODULE_ID index ,
18854  PORTS_CHANNEL channel ,
18855  PORTS_BIT_POS bitPos ) ;
18856 // *****************************************************************************
18857 /* Function:
18858  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18859  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18860  Summary:
18861  Disables CN interrupt for the selected pin.
18862  Description:
18863  This function disables Change Notice interrupt for the selected port pin.
18864  This function does not perform atomic register access.
18865  Precondition:
18866  None.
18867  Parameters:
18868  index - Identifier for the device instance to be configured
18869  channel - Port pin channel
18870  bitPos - Position in the PORT pins
18871  Returns:
18872  None.
18873  Example:
18874  <code>
18875 
18876  // Disable CN interrupt for RC5 pin
18877  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18878  PORTS_BIT_POS_5);
18879 
18880  </code>
18881  Remarks:
18882  This function is only available in devices with PPS. For Non-PPS devices, use the
18883  PLIB_PORTS_PinChangeNoticeDisable function.
18884 
18885  This feature may not be available on all devices. Please refer to the
18886  specific device data sheet to determine availability or use
18887  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18888  determine whether this feature is available.
18889 */
18890 
18891 void
18893  PORTS_MODULE_ID index ,
18894  PORTS_CHANNEL channel ,
18895  PORTS_BIT_POS bitPos ) ;
18896 // *****************************************************************************
18897 /* Function:
18898  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18899  PORTS_CHANNEL channel );
18900  Summary:
18901  Enables the change notification for selected port.
18902  Description:
18903  This function enables the change notification for selected port.
18904  This function does not perform atomic register access.
18905  Precondition:
18906  None.
18907  Parameters:
18908  index - Identifier for the device instance to be configured
18909  channel - Port pin channel
18910  Returns:
18911  None.
18912  Example:
18913  <code>
18914  // Enable Change notification for Port C
18915  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18916 
18917  </code>
18918  Remarks:
18919  This function is only available in devices with PPS. For Non-PPS devices, use the
18920  PLIB_PORTS_ChangeNoticeEnable function.
18921 
18922  This feature may not be available on all devices. Please refer to the
18923  specific device data sheet to determine availability or use
18924  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18925  whether this feature is available.
18926 */
18927 
18928 void
18930  PORTS_MODULE_ID index ,
18931  PORTS_CHANNEL channel ) ;
18932 // *****************************************************************************
18933 /* Function:
18934  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18935  PORTS_CHANNEL channel );
18936  Summary:
18937  Disables the change notification for selected port.
18938  Description:
18939  This function disables the change notification for selected port.
18940  This function does not perform atomic register access.
18941  Precondition:
18942  None.
18943  Parameters:
18944  index - Identifier for the device instance to be configured
18945  channel - Port pin channel
18946  Returns:
18947  None.
18948  Example:
18949  <code>
18950  // Disable Change notification for Port C
18951  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18952 
18953  </code>
18954  Remarks:
18955  This function is only available in devices with PPS. For Non-PPS devices, use the
18956  PLIB_PORTS_ChangeNoticeDisable function.
18957 
18958  This feature may not be available on all devices. Please refer to the
18959  specific device data sheet to determine availability or use
18960  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18961  whether this feature is available.
18962 */
18963 
18964 void
18966  PORTS_MODULE_ID index ,
18967  PORTS_CHANNEL channel ) ;
18968 // *****************************************************************************
18969 /* Function:
18970  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18971  PORTS_CHANNEL channel );
18972  Summary:
18973  Allows CN to be working in Idle mode for selected channel.
18974  Description:
18975  This function makes sure that change notification feature keeps working in
18976  Idle mode for the selected channel.
18977  This function does not perform atomic register access.
18978  Precondition:
18979  None.
18980  Parameters:
18981  index - Identifier for the device instance to be configured
18982  channel - Port pin channel
18983  Returns:
18984  None.
18985  Example:
18986  <code>
18987 
18988  // Change notification continues working in Idle mode for Port C
18989  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18990 
18991  </code>
18992  Remarks:
18993  This function is only available in devices with PPS. For Non-PPS devices, use the
18994  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18995 
18996  This feature may not be available on all devices. Please refer to the
18997  specific device data sheet to determine availability or use
18998  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18999  whether this feature is available.
19000 */
19001 
19002 void
19004  PORTS_MODULE_ID index ,
19005  PORTS_CHANNEL channel ) ;
19006 // *****************************************************************************
19007 /* Function:
19008  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19009  PORTS_CHANNEL channel );
19010  Summary:
19011  Change Notification halts in Idle mode for selected channel.
19012  Description:
19013  This function makes sure that change notification feature halts in
19014  Idle mode for the selected channel.
19015  This function does not perform atomic register access.
19016  Precondition:
19017  None.
19018  Parameters:
19019  index - Identifier for the device instance to be configured
19020  channel - Port pin channel
19021  Returns:
19022  None.
19023  Example:
19024  <code>
19025 
19026  // Change notification halts in Idle mode for Port C
19027  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19028 
19029  </code>
19030  Remarks:
19031  This function is only available in devices with PPS. For Non-PPS devices, use the
19032  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19033 
19034  This feature may not be available on all devices. Please refer to the
19035  specific device data sheet to determine availability or use
19036  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19037  whether this feature is available.
19038 */
19039 
19040 void
19042  PORTS_MODULE_ID index ,
19043  PORTS_CHANNEL channel ) ;
19044 // *****************************************************************************
19045 /* Function:
19046  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19047  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19048  Summary:
19049  checks the status of change on the pin
19050  Description:
19051  This function checks if the change has occurred on the given pin or not.
19052  This function does not perform atomic register access.
19053  Precondition:
19054  None.
19055  Parameters:
19056  index - Identifier for the device instance to be configured
19057  channel - Port pin channel
19058  bitPos - Position in the PORT pins
19059  Returns:
19060  None.
19061  Example:
19062  <code>
19063 
19064  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19065  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19066  {
19067  //do something
19068  }
19069 
19070  </code>
19071  Remarks:
19072  This feature may not be available on all devices. Please refer to the
19073  specific device data sheet to determine availability or use
19074  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19075  whether this feature is available.
19076 */
19077 
19078 bool
19080  PORTS_MODULE_ID index ,
19081  PORTS_CHANNEL channel ,
19082  PORTS_BIT_POS bitPos ) ;
19083 // *****************************************************************************
19084 /* Function:
19085  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19086  PORTS_BIT_POS bitPos )
19087  Summary:
19088  Reads/Gets data from the selected digital pin.
19089  Description:
19090  This function reads/gets data from the selected digital PORT i/o pin.
19091  This function should be used to read the live data at the pin.
19092  This function does not perform atomic register access.
19093 
19094  Precondition:
19095  None.
19096  Parameters:
19097  index - Identifier for the device instance to be configured
19098  channel - Identifier for the Ports channel A, B, C, etc.
19099  bitPos - Possible values of PORTS_BIT_POS
19100  Returns:
19101  Port pin read data.
19102  Example:
19103  <code>
19104  // read port pin RC4
19105  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19106  PORTS_BIT_POS_4);
19107  </code>
19108  Remarks:
19109  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19110 
19111  This feature may not be available on all devices. Please refer to the
19112  specific device data sheet to determine availability or use
19113  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19114  this feature is available.
19115 */
19116 
19117 bool
19119  PORTS_MODULE_ID index ,
19120  PORTS_CHANNEL channel ,
19121  PORTS_BIT_POS bitPos ) ;
19122 // *****************************************************************************
19123 /* Function:
19124  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19125  PORTS_BIT_POS bitPos )
19126  Summary:
19127  Reads/Gets data from the selected latch.
19128  Description:
19129  This function reads/gets data from the selected PORTx Data Latch, not from
19130  the port I/O pins.
19131  This function does not perform atomic register access.
19132 
19133  Precondition:
19134  None.
19135  Parameters:
19136  index - Identifier for the device instance to be configured
19137  channel - Identifier for the Ports channel A, B, C, etc.
19138  bitPos - Possible values of PORTS_BIT_POS
19139  Returns:
19140  Latch read data.
19141  Example:
19142  <code>
19143  // read latch RC4
19144  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19145  PORTS_BIT_POS_4);
19146  </code>
19147  Remarks:
19148  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19149  should be used.
19150 
19151  This feature may not be available on all devices. Please refer to the
19152  specific device data sheet to determine availability or use
19153  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19154  this feature is available.
19155 */
19156 
19157 bool
19159  PORTS_MODULE_ID index ,
19160  PORTS_CHANNEL channel ,
19161  PORTS_BIT_POS bitPos ) ;
19162 // *****************************************************************************
19163 /* Function:
19164  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19165  PORTS_BIT_POS bitPos,
19166  bool value )
19167  Summary:
19168  Writes the selected digital pin/latch.
19169  Description:
19170  This function writes to the selected digital pin/latch.
19171  This function does not perform atomic register access.
19172  Precondition:
19173  None.
19174  Parameters:
19175  index - Identifier for the device instance to be configured
19176  channel - Identifier for the Ports channel A, B, C, etc.
19177  bitPos - Possible values of PORTS_BIT_POS
19178  value - Value to be written to the specific pin/latch
19179  true - sets the bit, false - clears the bit
19180  Returns:
19181  None.
19182  Example:
19183  <code>
19184 
19185  // write 'one' in port RC4
19186  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19187 
19188  </code>
19189  Remarks:
19190  This feature may not be available on all devices. Please refer to the
19191  specific device data sheet to determine availability or use
19192  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19193  this feature is available.
19194 */
19195 
19196 void
19198  PORTS_MODULE_ID index ,
19199  PORTS_CHANNEL channel ,
19200  PORTS_BIT_POS bitPos ,
19201  bool value ) ;
19202 // *****************************************************************************
19203 /* Function:
19204  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19205  PORTS_BIT_POS bitPos )
19206  Summary:
19207  Sets the selected digital pin/latch.
19208  Description:
19209  This function sets the selected digital pin/latch.
19210  This function does not perform atomic register access.
19211  Precondition:
19212  None.
19213  Parameters:
19214  index - Identifier for the device instance to be configured
19215  channel - Identifier for the Ports channel A, B, C, etc.
19216  bitPos - Possible values of PORTS_BIT_POS
19217  Returns:
19218  None.
19219  Example:
19220  <code>
19221 
19222  // Sets port pin RC4
19223  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19224 
19225  </code>
19226  Remarks:
19227  This feature may not be available on all devices. Please refer to the
19228  specific device data sheet to determine availability or use
19229  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19230  this feature is available.
19231 */
19232 
19233 void
19235  PORTS_MODULE_ID index ,
19236  PORTS_CHANNEL channel ,
19237  PORTS_BIT_POS bitPos ) ;
19238 // *****************************************************************************
19239 /* Function:
19240  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19241  PORTS_BIT_POS bitPos )
19242  Summary:
19243  Clears the selected digital pin/latch.
19244  Description:
19245  This function clears the selected digital pin/latch.
19246  This function does not perform atomic register access.
19247  Precondition:
19248  None.
19249  Parameters:
19250  index - Identifier for the device instance to be configured
19251  channel - Identifier for the Ports channel A, B, C, etc.
19252  bitPos - Possible values of PORTS_BIT_POS
19253  Returns:
19254  None.
19255  Example:
19256  <code>
19257 
19258  // Clears port pin RC4
19259  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19260 
19261  </code>
19262  Remarks:
19263  This feature may not be available on all devices. Please refer to the
19264  specific device data sheet to determine availability or use
19265  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19266  this feature is available.
19267 */
19268 
19269 void
19271  PORTS_MODULE_ID index ,
19272  PORTS_CHANNEL channel ,
19273  PORTS_BIT_POS bitPos ) ;
19274 // *****************************************************************************
19275 /* Function:
19276  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19277  PORTS_BIT_POS bitPos )
19278  Summary:
19279  Toggles the selected digital pin/latch.
19280  Description:
19281  This function toggles the selected digital pin/latch.
19282  This function does not perform atomic register access.
19283  Precondition:
19284  None.
19285  Parameters:
19286  index - Identifier for the device instance to be configured
19287  channel - Identifier for the Ports channel A, B, C, etc.
19288  bitPos - Possible values of PORTS_BIT_POS
19289  Returns:
19290  None.
19291  Example:
19292  <code>
19293 
19294  // Toggles port pin RC4
19295  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19296 
19297  </code>
19298  Remarks:
19299  This feature may not be available on all devices. Please refer to the
19300  specific device data sheet to determine availability or use
19301  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19302  this feature is available.
19303 */
19304 
19305 void
19307  PORTS_MODULE_ID index ,
19308  PORTS_CHANNEL channel ,
19309  PORTS_BIT_POS bitPos ) ;
19310 // *****************************************************************************
19311 /* Function:
19312  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19313  PORTS_BIT_POS bitPos )
19314  Summary:
19315  Makes the selected pin direction input
19316  Description:
19317  This function makes the selected pin direction as input
19318  This function does not perform atomic register access.
19319  Precondition:
19320  None.
19321  Parameters:
19322  index - Identifier for the device instance to be configured
19323  channel - Identifier for the Ports channel A, B, C, etc.
19324  bitPos - Possible values of PORTS_BIT_POS direction that has to
19325  be made input
19326  Returns:
19327  None.
19328  Example:
19329  <code>
19330 
19331  // make pin RC4 as input
19332  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19333 
19334  </code>
19335  Remarks:
19336  This feature may not be available on all devices. Please refer to the
19337  specific device data sheet to determine availability or use
19338  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19339  this feature is available.
19340 */
19341 
19342 void
19344  PORTS_MODULE_ID index ,
19345  PORTS_CHANNEL channel ,
19346  PORTS_BIT_POS bitPos ) ;
19347 // *****************************************************************************
19348 /* Function:
19349  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19350  PORTS_BIT_POS bitPos )
19351  Summary:
19352  Makes the selected pin direction output
19353  Description:
19354  This function makes the selected pin direction as output
19355  This function does not perform atomic register access.
19356  Precondition:
19357  None.
19358  Parameters:
19359  index - Identifier for the device instance to be configured
19360  channel - Identifier for the Ports channel A, B, C, etc.
19361  bitPos - Possible values of PORTS_BIT_POS direction that has to
19362  be made output
19363  Returns:
19364  None.
19365  Example:
19366  <code>
19367 
19368  // make pin RC4 as output
19369  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19370 
19371  </code>
19372  Remarks:
19373  This feature may not be available on all devices. Please refer to the
19374  specific device data sheet to determine availability or use
19375  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19376  this feature is available.
19377 */
19378 
19379 void
19381  PORTS_MODULE_ID index ,
19382  PORTS_CHANNEL channel ,
19383  PORTS_BIT_POS bitPos ) ;
19384 // *****************************************************************************
19385 /* Function:
19386  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19387  PORTS_BIT_POS bitPos )
19388  Summary:
19389  Enables the open drain functionality for the selected pin.
19390  Description:
19391  This function enables the open drain functionality for the selected pin.
19392  This function does not perform atomic register access.
19393  Precondition:
19394  None.
19395  Parameters:
19396  index - Identifier for the device instance to be configured
19397  channel - Identifier for the Ports channel A, B, C, etc.
19398  bitPos - Possible values of PORTS_BIT_POS
19399  Returns:
19400  None.
19401  Example:
19402  <code>
19403 
19404  // Enable open drain for pin RC4
19405  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19406 
19407  </code>
19408  Remarks:
19409  This feature may not be available on all devices. Please refer to the
19410  specific device data sheet to determine availability or use
19411  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19412  this feature is available.
19413 */
19414 
19415 void
19417  PORTS_MODULE_ID index ,
19418  PORTS_CHANNEL channel ,
19419  PORTS_BIT_POS bitPos ) ;
19420 // *****************************************************************************
19421 /* Function:
19422  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19423  PORTS_BIT_POS bitPos )
19424  Summary:
19425  Disables the open drain functionality for the selected pin.
19426  Description:
19427  This function disables the open drain functionality for the selected pin.
19428  This function does not perform atomic register access.
19429  Precondition:
19430  None.
19431  Parameters:
19432  index - Identifier for the device instance to be configured
19433  channel - Identifier for the Ports channel A, B, C, etc.
19434  bitPos - One of the possible values of PORTS_BIT_POS.
19435  Returns:
19436  None.
19437  Example:
19438  <code>
19439 
19440  // Disable open drain for pin RC4
19441  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19442 
19443  </code>
19444  Remarks:
19445  This feature may not be available on all devices. Please refer to the
19446  specific device data sheet to determine availability or use
19447  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19448  this feature is available.
19449 */
19450 
19451 void
19453  PORTS_MODULE_ID index ,
19454  PORTS_CHANNEL channel ,
19455  PORTS_BIT_POS bitPos ) ;
19456 // *****************************************************************************
19457 /* Function:
19458  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19459  (
19460  PORTS_MODULE_ID index,
19461  PORTS_CHANNEL channel
19462  )
19463  Summary:
19464  Reads and returns data from the selected Latch.
19465  Description:
19466  This function reads and returns the data from the selected Latch.
19467  This function does not perform atomic register access.
19468 
19469  Precondition:
19470  None.
19471  Parameters:
19472  index - Identifier for the device instance to be configured
19473  channel - Identifier for the Ports channel A, B, C, etc.
19474  Returns:
19475  Latch read data.
19476  Example:
19477  <code>
19478  // Read latch C
19479  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19480 
19481  </code>
19482  Remarks:
19483  For reading the Live data, PLIB_PORTS_Read function should be used.
19484 
19485  This feature may not be available on all devices. Please refer to the
19486  specific device data sheet to determine availability or use
19487  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19488  this feature is available.
19489 */
19490 
19493  PORTS_MODULE_ID index ,
19494  PORTS_CHANNEL channel ) ;
19495 // *****************************************************************************
19496 /* Function:
19497  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19498  Summary:
19499  Reads the selected digital port.
19500  Description:
19501  This function reads from the selected digital port.
19502  This function does not perform atomic register access.
19503  Precondition:
19504  None.
19505  Parameters:
19506  index - Identifier for the device instance to be configured
19507  channel - Identifier for the Ports channel A, B, C, etc.
19508  Returns:
19509  data on a port with width PORTS_DATA_TYPE
19510  Example:
19511  <code>
19512 
19513  // Read PORT C
19514  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19515 
19516  </code>
19517  Remarks:
19518  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19519 
19520  This feature may not be available on all devices. Please refer to the
19521  specific device data sheet to determine availability or use
19522  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19523  this feature is available.
19524 */
19525 
19527  PLIB_PORTS_Read (
19528  PORTS_MODULE_ID index ,
19529  PORTS_CHANNEL channel ) ;
19530 // *****************************************************************************
19531 /* Function:
19532  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19533  PORTS_DATA_TYPE value )
19534  Summary:
19535  Writes the selected digital port/latch.
19536  Description:
19537  This function writes to the selected digital port/latch.
19538  This function does not perform atomic register access.
19539  Precondition:
19540  None.
19541  Parameters:
19542  index - Identifier for the device instance to be configured
19543  channel - Identifier for the Ports channel A, B, C, etc.
19544  value - Value to be written into a port of width PORTS_DATA_TYPE
19545  Returns:
19546  None.
19547  Example:
19548  <code>
19549 
19550  // Write 0x12 into PORT C
19551  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19552 
19553  </code>
19554  Remarks:
19555  This feature may not be available on all devices. Please refer to the
19556  specific device data sheet to determine availability or use
19557  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19558  this feature is available.
19559 */
19560 
19561 void
19563  PORTS_MODULE_ID index ,
19564  PORTS_CHANNEL channel ,
19565  PORTS_DATA_TYPE value ) ;
19566 // *****************************************************************************
19567 /* Function:
19568  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19569  PORTS_DATA_TYPE value,
19570  PORTS_DATA_MASK mask )
19571  Summary:
19572  Sets the selected bits of the port.
19573  Description:
19574  This function performs an 'AND' operation on the value and mask parameters,
19575  and then sets the bits in the port channel that were set by the result of the
19576  'AND' operation.
19577  This function does not perform atomic register access.
19578  Precondition:
19579  None.
19580  Parameters:
19581  index - Identifier for the device instance to be configured
19582  channel - Identifier for the Ports channel A, B, C, etc.
19583  value - Consists of information about which port bit has to be
19584  set and which not
19585  mask - Identifies the bits which could be intended for setting
19586  Returns:
19587  None.
19588  Example:
19589  <code>
19590 
19591  // MY_VALUE - 0x1234
19592  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19593 
19594  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19595  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19596 
19597  </code>
19598  Remarks:
19599  This feature may not be available on all devices. Please refer to the
19600  specific device data sheet to determine availability or use
19601  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19602  this feature is available.
19603 */
19604 
19605 void
19606  PLIB_PORTS_Set (
19607  PORTS_MODULE_ID index ,
19608  PORTS_CHANNEL channel ,
19609  PORTS_DATA_TYPE value ,
19610  PORTS_DATA_MASK mask ) ;
19611 // *****************************************************************************
19612 /* Function:
19613  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19614  PORTS_DATA_MASK toggleMask )
19615  Summary:
19616  Toggles the selected digital port/latch.
19617  Description:
19618  This function toggles the selected digital port/latch.
19619  This function does not perform atomic register access.
19620  Precondition:
19621  None.
19622  Parameters:
19623  index - Identifier for the device instance to be configured
19624  channel - Identifier for the Ports channel A, B, C, etc.
19625  toggleMask - Identifies the bits to be toggled
19626  Returns:
19627  None.
19628  Example:
19629  <code>
19630 
19631  // Toggles the three least significant Port C bits
19632  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19633 
19634  </code>
19635  Remarks:
19636  This feature may not be available on all devices. Please refer to the
19637  specific device data sheet to determine availability or use
19638  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19639  this feature is available.
19640 */
19641 
19642 void
19644  PORTS_MODULE_ID index ,
19645  PORTS_CHANNEL channel ,
19646  PORTS_DATA_MASK toggleMask ) ;
19647 // *****************************************************************************
19648 /* Function:
19649  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19650  PORTS_DATA_MASK clearMask )
19651  Summary:
19652  Clears the selected digital port/latch bits.
19653  Description:
19654  This function clears the selected digital port/latch bits.
19655  This function does not perform atomic register access.
19656  Precondition:
19657  None.
19658  Parameters:
19659  index - Identifier for the device instance to be configured
19660  channel - Identifier for the Ports channel A, B, C, etc.
19661  clearMask - Identifies the bits to be cleared
19662  Returns:
19663  None.
19664  Example:
19665  <code>
19666 
19667  // Clears the three least significant Port C bits
19668  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19669 
19670  </code>
19671  Remarks:
19672  This feature may not be available on all devices. Please refer to the
19673  specific device data sheet to determine availability or use
19674  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19675  this feature is available.
19676 */
19677 
19678 void
19680  PORTS_MODULE_ID index ,
19681  PORTS_CHANNEL channel ,
19682  PORTS_DATA_MASK clearMask ) ;
19683 // *****************************************************************************
19684 /* Function:
19685  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19686  PORTS_DATA_MASK mask )
19687  Summary:
19688  Makes the selected pins direction input.
19689  Description:
19690  This function makes the selected pins direction input.
19691  This function does not perform atomic register access.
19692 
19693  Precondition:
19694  None.
19695  Parameters:
19696  index - Identifier for the device instance to be configured
19697  channel - Identifier for the Ports channel A, B, C, etc.
19698  mask - Identifies the pins direction that has to be made input
19699  Returns:
19700  None.
19701  Example:
19702  <code>
19703 
19704  // Make RC0, RC1 and RC2 pins as Input
19705  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19706 
19707  </code>
19708  Remarks:
19709  This feature may not be available on all devices. Please refer to the
19710  specific device data sheet to determine availability or use
19711  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19712  this feature is available.
19713 */
19714 
19715 void
19717  PORTS_MODULE_ID index ,
19718  PORTS_CHANNEL channel ,
19719  PORTS_DATA_MASK mask ) ;
19720 // *****************************************************************************
19721 /* Function:
19722  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19723  PORTS_DATA_MASK mask )
19724  Summary:
19725  Makes the selected pins direction output.
19726  Description:
19727  This function makes the selected pins direction output.
19728  This function does not perform atomic register access.
19729  Precondition:
19730  None.
19731  Parameters:
19732  index - Identifier for the device instance to be configured
19733  channel - Identifier for the Ports channel A, B, C, etc.
19734  mask - Identifies the pins direction that has to be made output
19735  Returns:
19736  None.
19737  Example:
19738  <code>
19739 
19740  // Make RC0, RC1 and RC2 pins as Output
19741  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19742 
19743  </code>
19744  Remarks:
19745  This feature may not be available on all devices. Please refer to the
19746  specific device data sheet to determine availability or use
19747  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19748  this feature is available.
19749 */
19750 
19751 void
19753  PORTS_MODULE_ID index ,
19754  PORTS_CHANNEL channel ,
19755  PORTS_DATA_MASK mask ) ;
19756 // *****************************************************************************
19757 /* Function:
19758  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19759  Summary:
19760  Reads the direction of the selected digital port.
19761  Description:
19762  This function reads the direction of the selected digital port.
19763  This function does not perform atomic register access.
19764  Precondition:
19765  None.
19766  Parameters:
19767  index - Identifier for the device instance to be configured
19768  channel - Identifier for the Ports channel A, B, C, etc.
19769  Returns:
19770  Direction of the selected port of type PORTS_DATA_MASK
19771  Example:
19772  <code>
19773 
19774  // Reads the direction of Port C pins
19775  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19776 
19777  </code>
19778  Remarks:
19779  This feature may not be available on all devices. Please refer to the
19780  specific device data sheet to determine availability or use
19781  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19782  this feature is available.
19783 */
19784 
19787  PORTS_MODULE_ID index ,
19788  PORTS_CHANNEL channel ) ;
19789 // *****************************************************************************
19790 /* Function:
19791  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19792  PORTS_DATA_MASK mask )
19793  Summary:
19794  Enables the open drain functionality for the selected port pins.
19795  Description:
19796  This function enables the open drain functionality for the selected port pins.
19797  This function does not perform atomic register access.
19798  Precondition:
19799  None.
19800  Parameters:
19801  index - Identifier for the device instance to be configured
19802  channel - Identifier for the Ports channel A, B, C, etc.
19803  mask - Identifies the pins for the open drain to be enabled
19804  Returns:
19805  None.
19806  Example:
19807  <code>
19808 
19809  // Enable Open Drain for RC0, RC1 and RC2 pins
19810  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19811 
19812  </code>
19813  Remarks:
19814  This feature may not be available on all devices. Please refer to the
19815  specific device data sheet to determine availability or use
19816  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19817  this feature is available.
19818 */
19819 
19820 void
19822  PORTS_MODULE_ID index ,
19823  PORTS_CHANNEL channel ,
19824  PORTS_DATA_MASK mask ) ;
19825 // *****************************************************************************
19826 /* Function:
19827  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19828  PORTS_DATA_MASK mask )
19829  Summary:
19830  Disables the open drain functionality for the selected port.
19831  Description:
19832  This function disables the open drain functionality for the selected port.
19833  This function does not perform atomic register access.
19834 
19835  Precondition:
19836  None.
19837  Parameters:
19838  index - Identifier for the device instance to be configured
19839  channel - Identifier for the Ports channel A, B, C, etc.
19840  mask - Identifies the pins for the open drain to be disabled
19841  Returns:
19842  None.
19843  Example:
19844  <code>
19845 
19846  // Disable Open Drain for RC0, RC1 and RC2 pins
19847  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19848 
19849  </code>
19850  Remarks:
19851  This feature may not be available on all devices. Please refer to the
19852  specific device data sheet to determine availability or use
19853  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19854  this feature is available.
19855 */
19856 
19857 void
19859  PORTS_MODULE_ID index ,
19860  PORTS_CHANNEL channel ,
19861  PORTS_DATA_MASK mask ) ;
19862 // *****************************************************************************
19863 /* Function:
19864  void PLIB_PORTS_ChannelModeSelect
19865  (
19866  PORTS_MODULE_ID index,
19867  PORTS_CHANNEL channel,
19868  PORTS_DATA_MASK modeMask,
19869  PORTS_PIN_MODE mode
19870  );
19871  Summary:
19872  Enables the selected channel pins as analog or digital.
19873  Description:
19874  This function enables the selected channel pins as analog or digital.
19875  This function does not perform atomic register access.
19876  Precondition:
19877  None.
19878  Parameters:
19879  index - Identifier for the device instance to be configured
19880  channel - Port pin channel
19881  modeMask - Identifies the pins whose mode has to be modified.
19882  Modes of the pins whose corresponding bit is '1' get
19883  modified, mode of the other pins remains the same.
19884  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19885  Returns:
19886  None.
19887  Example:
19888  <code>
19889 
19890  // Make pins RC5, RC8 and RC13 Analog
19891  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19892 
19893  </code>
19894  Remarks:
19895  This function is only available in devices with PPS. For Non-PPS devices, use the
19896  PLIB_PORTS_AnPinsModeSelect function.
19897 
19898  This feature may not be available on all devices. Please refer to the
19899  specific device data sheet to determine availability or use
19900  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19901  this feature is available.
19902 */
19903 
19904 void
19906  PORTS_MODULE_ID index ,
19907  PORTS_CHANNEL channel ,
19908  PORTS_DATA_MASK modeMask ,
19909  PORTS_PIN_MODE mode ) ;
19910 // *****************************************************************************
19911 /* Function:
19912  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19913  (
19914  PORTS_MODULE_ID index,
19915  PORTS_CHANNEL channel,
19916  PORTS_DATA_MASK mask
19917  );
19918  Summary:
19919  Enables Change Notice pull-up for the selected channel pins.
19920  Description:
19921  This function enables the Change Notice pull-up for the selected
19922  channel pins.
19923  This function does not perform atomic register access.
19924  Precondition:
19925  None.
19926  Parameters:
19927  index - Identifier for the device instance to be configured
19928  channel - Port pin channel
19929  mask - Identifies the pins of the pull-up to be enabled
19930  Returns:
19931  None.
19932  Example:
19933  <code>
19934 
19935  // Enable pull-up for RC5, RC8 and RC13 pins
19936  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19937  0x2120);
19938  </code>
19939  Remarks:
19940  This function is only available in devices with PPS. For Non-PPS devices, use the
19941  PLIB_PORTS_CnPinsPullUpEnable function.
19942 
19943  This feature may not be available on all devices. Please refer to the
19944  specific device data sheet to determine availability or use
19945  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19946  determine whether this feature is available.
19947 */
19948 
19949 void
19951  PORTS_MODULE_ID index ,
19952  PORTS_CHANNEL channel ,
19953  PORTS_DATA_MASK mask ) ;
19954 // *****************************************************************************
19955 /* Function:
19956  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19957  (
19958  PORTS_MODULE_ID index,
19959  PORTS_CHANNEL channel,
19960  PORTS_DATA_MASK mask
19961  );
19962  Summary:
19963  Disables Change Notice pull-up for the selected channel pins.
19964  Description:
19965  This function Disables the Change Notice pull-up for the selected
19966  channel pins.
19967  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19968  Precondition:
19969  None.
19970  Parameters:
19971  index - Identifier for the device instance to be configured
19972  channel - Port pin channel
19973  mask - Identifies the pins of the pull-up to be disabled
19974  Returns:
19975  None.
19976  Example:
19977  <code>
19978 
19979  // Disable pull-up for RC5, RC8 and RC13 pins
19980  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19981  0x2120);
19982  </code>
19983  Remarks:
19984  This function is only available in devices with PPS. For Non-PPS devices, use the
19985  PLIB_PORTS_CnPinsPullUpDisable function.
19986 
19987  This feature may not be available on all devices. Please refer to the
19988  specific device data sheet to determine availability or use
19989  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19990  determine whether this feature is available.
19991 */
19992 
19993 void
19995  PORTS_MODULE_ID index ,
19996  PORTS_CHANNEL channel ,
19997  PORTS_DATA_MASK mask ) ;
19998 // *****************************************************************************
19999 /* Function:
20000  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
20001  (
20002  PORTS_MODULE_ID index,
20003  PORTS_CHANNEL channel,
20004  PORTS_DATA_MASK mask
20005  );
20006  Summary:
20007  Enables Change Notice pull-down for the selected channel pins.
20008  Description:
20009  This function enables the Change Notice pull-down for the selected
20010  channel pins.
20011  This function does not perform atomic register access.
20012  Precondition:
20013  None.
20014  Parameters:
20015  index - Identifier for the device instance to be configured
20016  channel - Port pin channel
20017  mask - Identifies the pins for the pull-down to be enabled
20018  Returns:
20019  None.
20020  Example:
20021  <code>
20022 
20023  // Enable pull-down for RC5, RC8 and RC13 pins
20024  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20025  0x2120);
20026  </code>
20027  Remarks:
20028  This feature may not be available on all devices. Please refer to the
20029  specific device data sheet to determine availability or use
20030  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20031  determine whether this feature is available.
20032 */
20033 
20034 void
20036  PORTS_MODULE_ID index ,
20037  PORTS_CHANNEL channel ,
20038  PORTS_DATA_MASK mask ) ;
20039 // *****************************************************************************
20040 /* Function:
20041  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20042  (
20043  PORTS_MODULE_ID index,
20044  PORTS_CHANNEL channel,
20045  PORTS_DATA_MASK mask
20046  );
20047  Summary:
20048  Disables Change Notice pull-down for the selected channel pins.
20049  Description:
20050  This function Disables the Change Notice pull-down for the selected
20051  channel pins.
20052  This function does not perform atomic register access.
20053  Precondition:
20054  None.
20055  Parameters:
20056  index - Identifier for the device instance to be configured
20057  channel - Port pin channel
20058  mask - Identifies the pins for the pull-down to be disabled
20059  Returns:
20060  None.
20061  Example:
20062  <code>
20063 
20064  // Disable pull-down for RC5, RC8 and RC13 pins
20065  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20066  0x2120);
20067  </code>
20068  Remarks:
20069  This feature may not be available on all devices. Please refer to the
20070  specific device data sheet to determine availability or use
20071  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20072  determine whether this feature is available.
20073 */
20074 
20075 void
20077  PORTS_MODULE_ID index ,
20078  PORTS_CHANNEL channel ,
20079  PORTS_DATA_MASK mask ) ;
20080 // *****************************************************************************
20081 /* Function:
20082  void PLIB_PORTS_ChannelChangeNoticeEnable
20083  (
20084  PORTS_MODULE_ID index,
20085  PORTS_CHANNEL channel,
20086  PORTS_DATA_MASK mask
20087  );
20088  Summary:
20089  Enables CN interrupt for the selected pins of a channel.
20090  Description:
20091  This function enables Change Notice interrupt for the selected port
20092  pins of a channel.
20093  This function does not perform atomic register access.
20094  Precondition:
20095  None.
20096  Parameters:
20097  index - Identifier for the device instance to be configured
20098  channel - Port pin channel
20099  mask - Identifies the pins for which change notification is
20100  to be enabled
20101  Returns:
20102  None.
20103  Example:
20104  <code>
20105 
20106  // Enable CN interrupt for RC5, RC8 and RC13 pins
20107  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20108 
20109  </code>
20110  Remarks:
20111  This function is only available in devices with PPS. For Non-PPS devices, use the
20112  PLIB_PORTS_CnPinsEnable function.
20113 
20114  This feature may not be available on all devices. Please refer to the
20115  specific device data sheet to determine availability or use
20116  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20117  determine whether this feature is available.
20118 */
20119 
20120 void
20122  PORTS_MODULE_ID index ,
20123  PORTS_CHANNEL channel ,
20124  PORTS_DATA_MASK mask ) ;
20125 // *****************************************************************************
20126 /* Function:
20127  void PLIB_PORTS_ChannelChangeNoticeDisable
20128  (
20129  PORTS_MODULE_ID index,
20130  PORTS_CHANNEL channel,
20131  PORTS_DATA_MASK mask
20132  );
20133  Summary:
20134  Disables CN interrupt for the selected pins of a channel.
20135  Description:
20136  This function Disables Change Notice interrupt for the selected port
20137  pins of a channel.
20138  This function does not perform atomic register access.
20139  Precondition:
20140  None.
20141  Parameters:
20142  index - Identifier for the device instance to be configured
20143  channel - Port pin channel
20144  mask - Identifies the pins for which change notification is
20145  to be disabled
20146  Returns:
20147  None.
20148  Example:
20149  <code>
20150 
20151  // Disable CN interrupt for RC5, RC8 and RC13 pins
20152  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20153 
20154  </code>
20155  Remarks:
20156  This function is only available in devices with PPS. For Non-PPS devices, use the
20157  PLIB_PORTS_CnPinsDisable function.
20158 
20159  This feature may not be available on all devices. Please refer to the
20160  specific device data sheet to determine availability or use
20161  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20162  determine whether this feature is available.
20163 */
20164 
20165 void
20167  PORTS_MODULE_ID index ,
20168  PORTS_CHANNEL channel ,
20169  PORTS_DATA_MASK mask ) ;
20170 // *****************************************************************************
20171 /* Function:
20172  void PLIB_PORTS_AnPinsModeSelect
20173  (
20174  PORTS_MODULE_ID index,
20175  PORTS_AN_PIN anPins,
20176  PORTS_PIN_MODE mode
20177  );
20178  Summary:
20179  Enables the selected AN pins as analog or digital.
20180  Description:
20181  This function enables the selected AN pins as analog or digital.
20182  This function does not perform atomic register access.
20183  Precondition:
20184  None.
20185  Parameters:
20186  index - Identifier for the device instance to be configured
20187  anPins - AN pins whose mode is to be changed. Multiple AN pins
20188  can be ORed.
20189  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20190  Returns:
20191  None.
20192  Example:
20193  <code>
20194 
20195  // Make pins AN5, AN8 and AN13 Analog
20196  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20197  PORTS_AN_PIN_8 |
20198  PORTS_AN_PIN_13,
20199  PORTS_PIN_MODE_ANALOG);
20200 
20201  </code>
20202  Remarks:
20203  This function is only available in devices without PPS feature. For PPS
20204  devices, use the PLIB_PORTS_ChannelModeSelect function.
20205 
20206  This feature may not be available on all devices. Please refer to the
20207  specific device data sheet to determine availability or use
20208  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20209  this feature is available.
20210 */
20211 
20212 void
20214  PORTS_MODULE_ID index ,
20215  PORTS_AN_PIN anPins ,
20216  PORTS_PIN_MODE mode ) ;
20217 // *****************************************************************************
20218 /* Function:
20219  void PLIB_PORTS_CnPinsPullUpEnable
20220  (
20221  PORTS_MODULE_ID index,
20222  PORTS_CN_PIN cnPins
20223  );
20224  Summary:
20225  Enables Change Notice pull-up for the selected channel pins.
20226  Description:
20227  This function enables the Change Notice pull-up for the selected
20228  channel pins.
20229  This function performs atomic register access.
20230  Precondition:
20231  None.
20232  Parameters:
20233  index - Identifier for the device instance to be configured
20234  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20235  can be ORed.
20236  Returns:
20237  None.
20238  Example:
20239  <code>
20240 
20241  // Enable pull-up for CN5, CN8 and CN13 pins
20242  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20243  CHANGE_NOTICE_PIN_8 |
20244  CHANGE_NOTICE_PIN_13);
20245 
20246  </code>
20247  Remarks:
20248  This function is only available in devices without PPS feature. For PPS
20249  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20250 
20251  This feature may not be available on all devices. Please refer to the
20252  specific device data sheet to determine availability or use
20253  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20254  determine whether this feature is available.
20255 */
20256 
20257 void
20259  PORTS_MODULE_ID index ,
20260  PORTS_CN_PIN cnPins ) ;
20261 // *****************************************************************************
20262 /* Function:
20263  void PLIB_PORTS_CnPinsPullUpDisable
20264  (
20265  PORTS_MODULE_ID index,
20266  PORTS_CN_PIN cnPins
20267  );
20268  Summary:
20269  Disables Change Notice pull-up for the selected channel pins.
20270  Description:
20271  This function Disables the Change Notice pull-up for the selected
20272  channel pins.
20273  This function performs atomic register access.
20274  Precondition:
20275  None.
20276  Parameters:
20277  index - Identifier for the device instance to be configured
20278  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20279  can be ORed.
20280  Returns:
20281  None.
20282  Example:
20283  <code>
20284 
20285  // Disable pull-up for CN5, CN8 and CN13 pins
20286  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20287  CHANGE_NOTICE_PIN_5 |
20288  CHANGE_NOTICE_PIN_8 |
20289  CHANGE_NOTICE_PIN_13);
20290 
20291  </code>
20292  Remarks:
20293  This function is only available in devices without PPS feature. For PPS
20294  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20295 
20296  This feature may not be available on all devices. Please refer to the
20297  specific device data sheet to determine availability or use
20298  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20299  determine whether this feature is available.
20300 */
20301 
20302 void
20304  PORTS_MODULE_ID index ,
20305  PORTS_CN_PIN cnPins ) ;
20306 // *****************************************************************************
20307 /* Function:
20308  void PLIB_PORTS_CnPinsEnable
20309  (
20310  PORTS_MODULE_ID index,
20311  PORTS_CN_PIN cnPins
20312  );
20313  Summary:
20314  Enables CN interrupt for the selected pins of a channel.
20315  Description:
20316  This function enables Change Notice interrupt for the selected port
20317  pins of a channel.
20318  This function performs atomic register access.
20319  Precondition:
20320  None.
20321  Parameters:
20322  index - Identifier for the device instance to be configured
20323  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20324  Returns:
20325  None.
20326  Example:
20327  <code>
20328 
20329  // Enable CN interrupt for CN5, CN8 and CN13 pins
20330  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20331  CHANGE_NOTICE_PIN_5 |
20332  CHANGE_NOTICE_PIN_8 |
20333  CHANGE_NOTICE_PIN_13);
20334 
20335  </code>
20336  Remarks:
20337  This function is only available in devices without PPS feature. For PPS
20338  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20339 
20340  This feature may not be available on all devices. Please refer to the
20341  specific device data sheet to determine availability or use
20342  PLIB_PORTS_ExistsPinChangeNotice in your application to
20343  determine whether this feature is available.
20344 */
20345 
20346 void
20348  PORTS_MODULE_ID index ,
20349  PORTS_CN_PIN cnPins ) ;
20350 // *****************************************************************************
20351 /* Function:
20352  void PLIB_PORTS_CnPinsDisable
20353  (
20354  PORTS_MODULE_ID index,
20355  PORTS_CN_PIN cnPins
20356  );
20357  Summary:
20358  Disables CN interrupt for the selected pins of a channel.
20359  Description:
20360  This function Disables Change Notice interrupt for the selected port
20361  pins of a channel.
20362  This function performs atomic register access.
20363  Precondition:
20364  None.
20365  Parameters:
20366  index - Identifier for the device instance to be configured
20367  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20368  Returns:
20369  None.
20370  Example:
20371  <code>
20372 
20373  // Disable CN interrupt for CN5, CN8 and CN13 pins
20374  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20375  CHANGE_NOTICE_PIN_5 |
20376  CHANGE_NOTICE_PIN_8 |
20377  CHANGE_NOTICE_PIN_13);
20378 
20379  </code>
20380  Remarks:
20381  This function is only available in devices without PPS feature. For PPS
20382  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20383 
20384  This feature may not be available on all devices. Please refer to the
20385  specific device data sheet to determine availability or use
20386  PLIB_PORTS_ExistsPinChangeNotice in your application to
20387  determine whether this feature is available.
20388 */
20389 
20390 void
20392  PORTS_MODULE_ID index ,
20393  PORTS_CN_PIN cnPins ) ;
20394 // *****************************************************************************
20395 /* Function:
20396  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20397  Summary:
20398  Global Change Notice enable.
20399  Description:
20400  This function enables the global Change Notice feature.
20401  This function performs atomic register access.
20402  Precondition:
20403  None.
20404  Parameters:
20405  index - Identifier for the device instance to be configured
20406  Returns:
20407  None.
20408  Example:
20409  <code>
20410 
20411  // Enable Change Notification
20412  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20413 
20414  </code>
20415  Remarks:
20416  This function is only available in devices without PPS. For PPS devices, use the
20417  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20418 
20419  This feature may not be available on all devices. Please refer to the
20420  specific device data sheet to determine availability or use
20421  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20422  this feature is available.
20423 */
20424 
20425 void
20427  PORTS_MODULE_ID index ) ;
20428 // *****************************************************************************
20429 /* Function:
20430  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20431  Summary:
20432  Global Change Notice disable.
20433  Description:
20434  This function disables the global Change Notice feature.
20435  Precondition:
20436  None.
20437  Parameters:
20438  index - Identifier for the device instance to be configured
20439  Returns:
20440  None.
20441  Example:
20442  <code>
20443 
20444  // Disable Change Notification
20445  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20446 
20447  </code>
20448  Remarks:
20449  This function is only available in devices without PPS. For PPS devices, use the
20450  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20451 
20452  This feature may not be available on all devices. Please refer to the
20453  specific device data sheet to determine availability or use
20454  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20455  this feature is available.
20456 */
20457 
20458 void
20460  PORTS_MODULE_ID index ) ;
20461 // *****************************************************************************
20462 /* Function:
20463  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20464  PORTS_CHANGE_NOTICE_PIN pinNum )
20465  Summary:
20466  Port pin Change Notice interrupt enable.
20467  Description:
20468  This function enables the port pin Change Notice feature.
20469  This function performs atomic register access.
20470  Precondition:
20471  None.
20472  Parameters:
20473  index - Identifier for the device instance to be configured
20474  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20475  Returns:
20476  None.
20477  Example:
20478  <code>
20479 
20480  // Enable Change Notice interrupt for pin CN13
20481  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20482 
20483  </code>
20484  Remarks:
20485  This function is only available in devices without PPS. For PPS devices, use the
20486  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20487 
20488  This feature may not be available on all devices. Please refer to the
20489  specific device data sheet to determine availability or use
20490  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20491  this feature is available.
20492 */
20493 
20494 void
20496  PORTS_MODULE_ID index ,
20497  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20498 // *****************************************************************************
20499 /* Function:
20500  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20501  PORTS_CHANGE_NOTICE_PIN pinNum )
20502  Summary:
20503  Port pin Change Notice disable.
20504  Description:
20505  This function disables the port pin Change Notice feature.
20506  This function performs atomic register access.
20507  Precondition:
20508  None.
20509  Parameters:
20510  index - Identifier for the device instance to be configured
20511  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20512  Returns:
20513  None.
20514  Example:
20515  <code>
20516 
20517  // Disable Change Notice interrupt for pin CN13
20518  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20519 
20520  </code>
20521  Remarks:
20522  This function is only available in devices without PPS. For PPS devices, use the
20523  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20524 
20525  This feature may not be available on all devices. Please refer to the
20526  specific device data sheet to determine availability or use
20527  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20528  this feature is available.
20529 */
20530 
20531 void
20533  PORTS_MODULE_ID index ,
20534  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20535 // *****************************************************************************
20536 /* Function:
20537  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20538  Summary:
20539  CPU Idle mode does not affect Change Notice operation.
20540  Description:
20541  This function makes sure that Change Notice feature continues working in
20542  Idle mode.
20543  This function performs atomic register access.
20544 
20545  Precondition:
20546  None.
20547  Parameters:
20548  index - Identifier for the device instance to be configured
20549  Returns:
20550  None.
20551  Example:
20552  <code>
20553 
20554  // Change notification feature will be working even when CPU goes to
20555  // Idle mode
20556  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20557 
20558  </code>
20559  Remarks:
20560  This function is only available in devices without PPS. For PPS devices, use the
20561  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20562 
20563  This feature may not be available on all devices. Please refer to the
20564  specific device data sheet to determine availability or use
20565  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20566  this feature is available.
20567 */
20568 
20569 void
20571  PORTS_MODULE_ID index ) ;
20572 // *****************************************************************************
20573 /* Function:
20574  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20575  Summary:
20576  CPU Idle halts the Change Notice operation.
20577  Description:
20578  This function halts the Change Notice operation when the CPU enters
20579  Idle mode.
20580  This function performs atomic register access.
20581  Precondition:
20582  None.
20583  Parameters:
20584  index - Identifier for the device instance to be configured
20585  Returns:
20586  None.
20587  Example:
20588  <code>
20589  // Halts the Change notification operation when CPU enters Idle mode
20590  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20591 
20592  </code>
20593  Remarks:
20594  This function is only available in devices without PPS. For PPS devices, use the
20595  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20596 
20597  This feature may not be available on all devices. Please refer to the
20598  specific device data sheet to determine availability or use
20599  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20600  this feature is available.
20601 */
20602 
20603 void
20605  PORTS_MODULE_ID index ) ;
20606 // *****************************************************************************
20607 /* Function:
20608  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20609  PORTS_CHANGE_NOTICE_PIN pinNum )
20610  Summary:
20611  Enable pull-up on input change.
20612  Description:
20613  This function enables pull-up on selected input change notification pin.
20614  This function performs atomic register access.
20615  Precondition:
20616  None.
20617  Parameters:
20618  index - Identifier for the device instance to be configured
20619  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20620  Returns:
20621  None.
20622  Example:
20623  <code>
20624 
20625  // Enable pull-up on pin CN13
20626  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20627 
20628  </code>
20629  Remarks:
20630  This function is only available in devices without PPS. For PPS devices, use the
20631  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20632 
20633  This feature may not be available on all devices. Please refer to the
20634  specific device data sheet to determine availability or use
20635  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20636  this feature is available.
20637 */
20638 
20639 void
20641  PORTS_MODULE_ID index ,
20642  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20643 // *****************************************************************************
20644 /* Function:
20645  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20646  PORTS_CHANGE_NOTICE_PIN pinNum )
20647  Summary:
20648  Disable pull-up on input change.
20649  Description:
20650  This function disables pull-up on selected input change notification pin.
20651  This function performs atomic register access.
20652  Precondition:
20653  None.
20654  Parameters:
20655  index - Identifier for the device instance to be configured
20656  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20657  Returns:
20658  None.
20659  Example:
20660  <code>
20661 
20662  // Disable pull-up on pin CN13
20663  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20664 
20665  </code>
20666  Remarks:
20667  This function is only available in devices without PPS. For PPS devices, use the
20668  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20669 
20670  This feature may not be available on all devices. Please refer to the
20671  specific device data sheet to determine availability or use
20672  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20673  this feature is available.
20674 */
20675 
20676 void
20678  PORTS_MODULE_ID index ,
20679  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20680 // *****************************************************************************
20681 /* Function:
20682  void PLIB_PORTS_ChannelSlewRateSelect
20683  (
20684  PORTS_MODULE_ID index,
20685  PORTS_CHANNEL channel,
20686  PORTS_DATA_MASK channelMask,
20687  PORTS_PIN_SLEW_RATE slewRate
20688  );
20689  Summary:
20690  Selects the slew rate for selected channel pins.
20691  Description:
20692  This function selects the slew rate for selected channel pins.
20693  This function does not perform atomic register access.
20694  Precondition:
20695  None.
20696  Parameters:
20697  index - Identifier for the device instance to be configured
20698  channel - Port pin channel
20699  channelMask - Identifies the pins for which slew rate has to be modified.
20700  Slew rate of the pins which corresponding bit is "1" get
20701  modified, slew rate of the other pins remains the same.
20702  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20703  Returns:
20704  None.
20705  Example:
20706  <code>
20707 
20708  // Make slew rate of pins RC5, RC8 and RC13 slowest
20709  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20710  PORT_CHANNEL_C,
20711  0x2120,
20712  PORTS_PIN_SLEW_RATE_SLOWEST);
20713 
20714  </code>
20715  Remarks:
20716  This feature may not be available on all devices. Please refer to the
20717  specific device data sheet to determine availability or use
20718  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20719  whether this feature is available.
20720 */
20721 
20722 void
20724  PORTS_MODULE_ID index ,
20725  PORTS_CHANNEL channel ,
20726  PORTS_DATA_MASK channelMask ,
20727  PORTS_PIN_SLEW_RATE slewRate ) ;
20728 // *****************************************************************************
20729 /* Function:
20730 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20731  (
20732  PORTS_MODULE_ID index,
20733  PORTS_CHANNEL channel,
20734  PORTS_BIT_POS bitPos
20735  );
20736  Summary:
20737  Gets the slew rate for selected port pin.
20738  Description:
20739  This function gets the slew rate of selected port pin.
20740  This function does not perform atomic register access.
20741  Precondition:
20742  None.
20743  Parameters:
20744  index - Identifier for the device instance to be configured
20745  channel - Port pin channel
20746  bitPos - One of the possible values of PORTS_BIT_POS.
20747  Returns:
20748  One of the possible values of PORTS_PIN_SLEW_RATE.
20749  Example:
20750  <code>
20751  PORTS_PIN_SLEW_RATE slewRate;
20752 
20753  // Get the slew rate of pin RC1
20754  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20755 
20756  </code>
20757  Remarks:
20758  This feature may not be available on all devices. Please refer to the
20759  specific device data sheet to determine availability or use
20760  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20761  whether this feature is available.
20762 */
20763 
20764 PORTS_PIN_SLEW_RATE
20766  PORTS_MODULE_ID index ,
20767  PORTS_CHANNEL channel ,
20768  PORTS_BIT_POS bitPos ) ;
20769 // *****************************************************************************
20770 /* Function:
20771  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20772  (
20773  PORTS_MODULE_ID index,
20774  PORTS_CHANNEL channel,
20775  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20776  );
20777  Summary:
20778  Selects the Change Notice style for selected port channel.
20779  Description:
20780  This function selects the Change Notice style (or method) for selected port
20781  channel. It allows user to select whether the Change Notice detection will
20782  happen based on edge transition or level transition on all the CN pins of a
20783  particular channel.
20784  This function does not perform atomic register access.
20785  Precondition:
20786  None.
20787  Parameters:
20788  index - Identifier for the device instance to be configured
20789  channel - Port pin channel
20790  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20791  Returns:
20792  None.
20793  Example:
20794  <code>
20795  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20796  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20797  </code>
20798  Remarks:
20799  This feature may not be available on all devices. Please refer to the
20800  specific device data sheet to determine availability or use
20801  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20802  whether this feature is available.
20803 */
20804 
20805 void
20807  PORTS_MODULE_ID index ,
20808  PORTS_CHANNEL channel ,
20809  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20810 // *****************************************************************************
20811 /* Function:
20812  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20813  (
20814  PORTS_MODULE_ID index,
20815  PORTS_CHANNEL channel
20816  );
20817  Summary:
20818  Gets the Change Notice style for the selected port channel.
20819  Description:
20820  This function gets the Change Notice style (or method) for the selected port
20821  channel.
20822  This function does not perform atomic register access.
20823  Precondition:
20824  None.
20825  Parameters:
20826  index - Identifier for the device instance to be configured
20827  channel - Port pin channel
20828  Returns:
20829  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20830  Example:
20831  <code>
20832  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20833  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20834  </code>
20835  Remarks:
20836  This feature may not be available on all devices. Please refer to the
20837  specific device data sheet to determine availability or use
20838  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20839  whether this feature is available.
20840 */
20841 
20842 PORTS_CHANGE_NOTICE_METHOD
20844  PORTS_MODULE_ID index ,
20845  PORTS_CHANNEL channel ) ;
20846 // *****************************************************************************
20847 /* Function:
20848  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20849  (
20850  PORTS_MODULE_ID index,
20851  PORTS_CHANNEL channel,
20852  PORTS_DATA_MASK edgeRisingMask,
20853  PORTS_DATA_MASK edgeFallingMask
20854  );
20855  Summary:
20856  Enables selected type of edge for selected CN pins.
20857  Description:
20858  This function Enables selected type of edge (falling or rising) for
20859  selected CN pins of a port channel.
20860  This function does not perform atomic register access.
20861  Precondition:
20862  Change Notice method should be selected as
20863  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20864  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20865  Parameters:
20866  index - Identifier for the device instance to be configured
20867  channel - Port pin channel
20868  edgeRisingMask - Identifies the pins for which Change Notice has to be
20869  enabled for rising edge. Change Notice interrupt at rising
20870  edge is enabled for the pins which corresponding bit is
20871  '1', for the other pins it remains the same.
20872  edgeFallingMask - Identifies the pins for which Change Notice has to be
20873  enabled for falling edge. Change Notice interrupt at
20874  falling edge is enabled for the pins which corresponding
20875  bit is '1', for the other pins it remains the same.
20876  Returns:
20877  None.
20878  Example:
20879  <code>
20880  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20881  // RC1 & RC5 pins.
20882  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20883  </code>
20884  Remarks:
20885  This feature is not available on all devices. Please refer to the
20886  specific device data sheet to determine availability or use
20887  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20888  whether this feature is available.
20889 */
20890 
20891 void
20893  PORTS_MODULE_ID index ,
20894  PORTS_CHANNEL channel ,
20895  PORTS_DATA_MASK edgeRisingMask ,
20896  PORTS_DATA_MASK edgeFallingMask ) ;
20897 // *****************************************************************************
20898 /* Function:
20899  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20900  (
20901  PORTS_MODULE_ID index,
20902  PORTS_CHANNEL channel,
20903  PORTS_DATA_MASK edgeRisingMask,
20904  PORTS_DATA_MASK edgeFallingMask
20905  );
20906  Summary:
20907  Disables selected type of edge for selected CN pins.
20908  Description:
20909  This function Disables selected type of edge (falling or rising) for
20910  selected CN pins of a port channel.
20911  This function does not perform atomic register access.
20912  Precondition:
20913  Change Notice method should be selected as
20914  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20915  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20916  Parameters:
20917  index - Identifier for the device instance to be configured
20918  channel - Port pin channel
20919  edgeRisingMask - Identifies the pins for which Change Notice has to be
20920  enabled for rising edge. Change notice interrupt at rising
20921  edge is enabled for the pins which corresponding bit is
20922  '1', for the other pins it remains the same.
20923  edgeFallingMask - Identifies the pins for which Change Notice has to be
20924  enabled for falling edge. Change notice interrupt at
20925  falling edge is enabled for the pins which corresponding
20926  bit is '1', for the other pins it remains the same.
20927  Returns:
20928  None.
20929  Example:
20930  <code>
20931  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20932  // RC1 & RC5 pins.
20933  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20934  </code>
20935  Remarks:
20936  This feature is not available on all devices. Please refer to the
20937  specific device data sheet to determine availability or use
20938  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20939  whether this feature is available.
20940 */
20941 
20942 void
20944  PORTS_MODULE_ID index ,
20945  PORTS_CHANNEL channel ,
20946  PORTS_DATA_MASK edgeRisingMask ,
20947  PORTS_DATA_MASK edgeFallingMask ) ;
20948 // *****************************************************************************
20949 /* Function:
20950  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20951  (
20952  PORTS_MODULE_ID index,
20953  PORTS_CHANNEL channel,
20954  PORTS_BIT_POS bitPos,
20955  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20956  );
20957  Summary:
20958  Check if Change Notice edge is enabled or not.
20959  This function does not perform atomic register access.
20960  Description:
20961  This function checks if selected type of Change Notice edge is enabled on a
20962  particular port pin or not.
20963  This function does not perform atomic register access.
20964  Precondition:
20965  None.
20966  Parameters:
20967  index - Identifier for the device instance to be configured
20968  channel - Port pin channel
20969  bitPos - One of the possible values of PORTS_BIT_POS.
20970  cnEdgeType - Type of the edge which has to be checked.
20971 
20972  Returns:
20973  - true - Selected type of Change Notice Edge is enabled.
20974  - false - Selected type of Change Notice Edge is not enabled.
20975 
20976  Example:
20977  <code>
20978  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20979  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20980  {
20981  // do something
20982  }
20983  </code>
20984  Remarks:
20985  This feature is not available on all devices. Please refer to the
20986  specific device data sheet to determine availability or use
20987  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20988  whether this feature is available.
20989 */
20990 
20991 bool
20993  PORTS_MODULE_ID index ,
20994  PORTS_CHANNEL channel ,
20995  PORTS_BIT_POS bitPos ,
20996  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20997 // *****************************************************************************
20998 /* Function:
20999  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21000  (
21001  PORTS_MODULE_ID index,
21002  PORTS_CHANNEL channel,
21003  PORTS_BIT_POS bitPos
21004  );
21005  Summary:
21006  Check Change Notice edge status.
21007  Description:
21008  This function checks whether or no a Change Notice edge transition has occurred
21009  on the selected port pin.
21010  This function does not perform atomic register access.
21011  Precondition:
21012  None.
21013  Parameters:
21014  index - Identifier for the device instance to be configured
21015  channel - Port pin channel
21016  bitPos - One of the possible values of PORTS_BIT_POS
21017 
21018  Returns:
21019  - true - Change Notice edge transition has occurred
21020  - false - Change Notice edge transition has not occurred
21021 
21022  Example:
21023  <code>
21024  // Check if Change Notice edge transition has occurred for pin RC1.
21025  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21026  {
21027  // do something
21028  }
21029  </code>
21030  Remarks:
21031  This feature is not available on all devices. Please refer to the
21032  specific device data sheet to determine availability or use
21033  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21034  whether this feature is available.
21035 */
21036 
21037 bool
21039  PORTS_MODULE_ID index ,
21040  PORTS_CHANNEL channel ,
21041  PORTS_BIT_POS bitPos ) ;
21042 // *****************************************************************************
21043 // *****************************************************************************
21044 // Section: Ports Peripheral Library Exists Functions
21045 // *****************************************************************************
21046 // *****************************************************************************
21047 /* The functions below indicate the existence of the features on the device.
21048 */
21049 //******************************************************************************
21050 /* Function:
21051  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21052  Summary:
21053  Identifies whether the RemapInput feature exists on the Ports module.
21054  Description:
21055  This function identifies whether the RemapInput feature is available on the
21056  Ports module.
21057  When this function returns true, this function is supported on the device:
21058  - PLIB_PORTS_RemapInput
21059  Preconditions:
21060  None.
21061  Parameters:
21062  index - Identifier for the device instance
21063  Returns:
21064  - true - The RemapInput feature is supported on the device
21065  - false - The RemapInput feature is not supported on the device
21066  Remarks:
21067  None.
21068 */
21069 
21070 bool
21072  PORTS_MODULE_ID index ) ;
21073 //******************************************************************************
21074 /* Function:
21075  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21076  Summary:
21077  Identifies whether the RemapOutput feature exists on the Ports module.
21078  Description:
21079  This function identifies whether the RemapOutput feature is available on the
21080  Ports module.
21081  When this function returns true, this function is supported on the device:
21082  - PLIB_PORTS_RemapOutput
21083  Preconditions:
21084  None.
21085  Parameters:
21086  index - Identifier for the device instance
21087  Returns:
21088  - true - The RemapOutput feature is supported on the device
21089  - false - The RemapOutput feature is not supported on the device
21090  Remarks:
21091  None.
21092 */
21093 
21094 bool
21096  PORTS_MODULE_ID index ) ;
21097 //******************************************************************************
21098 /* Function:
21099  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21100  Summary:
21101  Identifies whether the PinMode feature exists on the Ports module.
21102  Description:
21103  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21104  feature is available on the Ports module.
21105  When this function returns true, this function is supported on the device:
21106  - PLIB_PORTS_PinModeSelect
21107  Preconditions:
21108  None.
21109  Parameters:
21110  index - Identifier for the device instance
21111  Returns:
21112  - true - The PinMode feature is supported on the device
21113  - false - The PinMode feature is not supported on the device
21114  Remarks:
21115  None.
21116 */
21117 
21118 bool
21120  PORTS_MODULE_ID index ) ;
21121 //******************************************************************************
21122 /* Function:
21123  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21124  Summary:
21125  Identifies whether the AnPinsMode feature exists on the Ports module.
21126  Description:
21127  This function identifies whether the AnPinsMode feature is available on the
21128  Ports module.
21129  When this function returns true, this function is supported on the device:
21130  - PLIB_PORTS_AnPinsModeSelect
21131  Preconditions:
21132  None.
21133  Parameters:
21134  index - Identifier for the device instance
21135  Returns:
21136  - true - The AnPinsMode feature is supported on the device
21137  - false - The AnPinsMode feature is not supported on the device
21138  Remarks:
21139  None.
21140 */
21141 
21142 bool
21144  PORTS_MODULE_ID index ) ;
21145 //******************************************************************************
21146 /* Function:
21147  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21148  Summary:
21149  Identifies whether the PortsRead feature exists on the Ports module.
21150  Description:
21151  This function identifies whether the PortsRead feature is available on the
21152  Ports module.
21153  When this function returns true, these functions are supported on the device:
21154  - PLIB_PORTS_PinGet
21155  - PLIB_PORTS_Read
21156  Preconditions:
21157  None.
21158  Parameters:
21159  index - Identifier for the device instance
21160  Returns:
21161  - true - The PortsRead feature is supported on the device
21162  - false - The PortsRead feature is not supported on the device
21163  Remarks:
21164  None.
21165 */
21166 
21167 bool
21169  PORTS_MODULE_ID index ) ;
21170 //******************************************************************************
21171 /* Function:
21172  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21173  Summary:
21174  Identifies whether the LatchRead feature exists on the Ports module.
21175  Description:
21176  This function identifies whether the LatchRead feature is available on the
21177  Ports module.
21178  When this function returns true, these functions are supported on the device:
21179  - PLIB_PORTS_PinGetLatched
21180  - PLIB_PORTS_ReadLatched
21181  Preconditions:
21182  None.
21183  Parameters:
21184  index - Identifier for the device instance
21185  Returns:
21186  - true - The LatchRead feature is supported on the device
21187  - false - The LatchRead feature is not supported on the device
21188  Remarks:
21189  None.
21190 */
21191 
21192 bool
21194  PORTS_MODULE_ID index ) ;
21195 //******************************************************************************
21196 /* Function:
21197  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21198  Summary:
21199  Identifies whether the PortsWrite feature exists on the Ports module.
21200  Description:
21201  This function identifies whether the PortsWrite feature is available on the
21202  Ports module.
21203  When this function returns true, these functions are supported on the device:
21204  - PLIB_PORTS_PinWrite
21205  - PLIB_PORTS_PinSet
21206  - PLIB_PORTS_PinClear
21207  - PLIB_PORTS_PinToggle
21208  - PLIB_PORTS_Write
21209  - PLIB_PORTS_Set
21210  - PLIB_PORTS_Toggle
21211  - PLIB_PORTS_Clear
21212  Preconditions:
21213  None.
21214  Parameters:
21215  index - Identifier for the device instance
21216  Returns:
21217  - true - The PortsWrite feature is supported on the device
21218  - false - The PortsWrite feature is not supported on the device
21219  Remarks:
21220  None.
21221 */
21222 
21223 bool
21225  PORTS_MODULE_ID index ) ;
21226 //******************************************************************************
21227 /* Function:
21228  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21229  Summary:
21230  Identifies whether the PortsDirection feature exists on the Ports module.
21231  Description:
21232  This function identifies whether the PortsDirection feature is available on the
21233  Ports module.
21234  When this function returns true, these functions are supported on the device:
21235  - PLIB_PORTS_PinDirectionInputSet
21236  - PLIB_PORTS_PinDirectionOutputSet
21237  - PLIB_PORTS_DirectionInputSet
21238  - PLIB_PORTS_DirectionOutputSet
21239  - PLIB_PORTS_DirectionGet
21240  Preconditions:
21241  None.
21242  Parameters:
21243  index - Identifier for the device instance
21244  Returns:
21245  - true - The PortsDirection feature is supported on the device
21246  - false - The PortsDirection feature is not supported on the device
21247  Remarks:
21248  None.
21249 */
21250 
21251 bool
21253  PORTS_MODULE_ID index ) ;
21254 //******************************************************************************
21255 /* Function:
21256  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21257  Summary:
21258  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21259  Description:
21260  This function identifies whether the PortsOpenDrain feature is available on
21261  the Ports module.
21262  When this function returns true, these functions are supported on the device:
21263  - PLIB_PORTS_PinOpenDrainEnable
21264  - PLIB_PORTS_PinOpenDrainDisable
21265  - PLIB_PORTS_OpenDrainEnable
21266  - PLIB_PORTS_OpenDrainDisable
21267  Preconditions:
21268  None.
21269  Parameters:
21270  index - Identifier for the device instance
21271  Returns:
21272  - true - The PortsOpenDrain feature is supported on the device
21273  - false - The PortsOpenDrain feature is not supported on the device
21274  Remarks:
21275  None.
21276 */
21277 
21278 bool
21280  PORTS_MODULE_ID index ) ;
21281 //******************************************************************************
21282 /* Function:
21283  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21284  Summary:
21285  Identifies whether the ChangeNotice feature exists on the Ports module.
21286  Description:
21287  This function identifies whether the ChangeNotice feature is available on the
21288  Ports module.
21289  When this function returns true, these functions are supported on the device:
21290  - PLIB_PORTS_ChangeNoticeEnable
21291  - PLIB_PORTS_ChangeNoticeDisable
21292  Preconditions:
21293  None.
21294  Parameters:
21295  index - Identifier for the device instance
21296  Returns:
21297  - true - The ChangeNotice feature is supported on the device
21298  - false - The ChangeNotice feature is not supported on the device
21299  Remarks:
21300  None.
21301 */
21302 
21303 bool
21305  PORTS_MODULE_ID index ) ;
21306 //******************************************************************************
21307 /* Function:
21308  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21309  Summary:
21310  Identifies whether the PinChangeNotice feature exists on the Ports module.
21311  Description:
21312  This function identifies whether the PinChangeNotice feature is available on
21313  the Ports module.
21314  When this function returns true, these functions are supported on the device:
21315  - PLIB_PORTS_PinChangeNoticeEnable
21316  - PLIB_PORTS_PinChangeNoticeDisable
21317  - PLIB_PORTS_CnPinsEnable
21318  - PLIB_PORTS_CnPinsDisable
21319  Preconditions:
21320  None.
21321  Parameters:
21322  index - Identifier for the device instance
21323  Returns:
21324  - true - The PinChangeNotice feature is supported on the device
21325  - false - The PinChangeNotice feature is not supported on the device
21326  Remarks:
21327  None.
21328 */
21329 
21330 bool
21332  PORTS_MODULE_ID index ) ;
21333 //******************************************************************************
21334 /* Function:
21335  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21336  Summary:
21337  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21338  Description:
21339  This function identifies whether the ChangeNoticeInIdle feature is available
21340  on the Ports module.
21341  When this function returns true, these functions are supported on the device:
21342  - PLIB_PORTS_ChangeNoticeInIdleEnable
21343  - PLIB_PORTS_ChangeNoticeInIdleDisable
21344  Preconditions:
21345  None.
21346  Parameters:
21347  index - Identifier for the device instance
21348  Returns:
21349  - true - The ChangeNoticeInIdle feature is supported on the device
21350  - false - The ChangeNoticeInIdle feature is not supported on the device
21351  Remarks:
21352  None.
21353 */
21354 
21355 bool
21357  PORTS_MODULE_ID index ) ;
21358 //******************************************************************************
21359 /* Function:
21360  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21361  Summary:
21362  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21363  Description:
21364  This function identifies whether the ChangeNoticePullup feature is available
21365  on the Ports module.
21366  When this function returns true, these functions are supported on the device:
21367  - PLIB_PORTS_ChangeNoticePullUpEnable
21368  - PLIB_PORTS_ChangeNoticePullUpDisable
21369  - PLIB_PORTS_CnPinsPullUpEnable
21370  - PLIB_PORTS_CnPinsPullUpDisable
21371  Preconditions:
21372  None.
21373  Parameters:
21374  index - Identifier for the device instance
21375  Returns:
21376  - true - The ChangeNoticePullup feature is supported on the device
21377  - false - The ChangeNoticePullup feature is not supported on the device
21378  Remarks:
21379  None.
21380 */
21381 
21382 bool
21384  PORTS_MODULE_ID index ) ;
21385 //******************************************************************************
21386 /* Function:
21387  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21388  Summary:
21389  Identifies whether the PinModePerPort feature exists on the Ports module.
21390  Description:
21391  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21392  feature is available on the Ports module.
21393  When this function returns true, these functions are supported on the device:
21394  - PLIB_PORTS_PinModePerPortSelect
21395  - PLIB_PORTS_ChannelModeSelect
21396  Preconditions:
21397  None.
21398  Parameters:
21399  index - Identifier for the device instance
21400  Returns:
21401  - true - The PinModePerPort feature is supported on the device
21402  - false - The PinModePerPort feature is not supported on the device
21403  Remarks:
21404  None.
21405 */
21406 
21407 bool
21409  PORTS_MODULE_ID index ) ;
21410 //******************************************************************************
21411 /* Function:
21412  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21413  Summary:
21414  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21415  Ports module.
21416  Description:
21417  This function identifies whether the ChangeNoticePullDownPerPort feature is
21418  available on the Ports module.
21419  When this function returns true, these functions are supported on the device:
21420  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21421  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21422  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21423  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21424  Preconditions:
21425  None.
21426  Parameters:
21427  index - Identifier for the device instance
21428  Returns:
21429  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21430  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21431  Remarks:
21432  None.
21433 */
21434 
21435 bool
21437  PORTS_MODULE_ID index ) ;
21438 //******************************************************************************
21439 /* Function:
21440  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21441  Summary:
21442  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21443  module.
21444  Description:
21445  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21446  on the Ports module.
21447  When this function returns true, these functions are supported on the device:
21448  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21449  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21450  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21451  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21452  Preconditions:
21453  None.
21454  Parameters:
21455  index - Identifier for the device instance
21456  Returns:
21457  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21458  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21459  Remarks:
21460  None.
21461 */
21462 
21463 bool
21465  PORTS_MODULE_ID index ) ;
21466 //******************************************************************************
21467 /* Function:
21468  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21469  Summary:
21470  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21471  module.
21472  Description:
21473  This function identifies whether the PinChangeNoticePerPort feature is
21474  available on the Ports module.
21475  When this function returns true, these functions are supported on the device:
21476  - PLIB_PORTS_PinChangeNoticePerPortEnable
21477  - PLIB_PORTS_PinChangeNoticePerPortDisable
21478  - PLIB_PORTS_ChannelChangeNoticeEnable
21479  - PLIB_PORTS_ChannelChangeNoticeDisable
21480  Preconditions:
21481  None.
21482  Parameters:
21483  index - Identifier for the device instance
21484  Returns:
21485  - true - The PinChangeNoticePerPort feature is supported on the device
21486  - false - The PinChangeNoticePerPort feature is not supported on the device
21487  Remarks:
21488  None.
21489 */
21490 
21491 bool
21493  PORTS_MODULE_ID index ) ;
21494 //******************************************************************************
21495 /* Function:
21496  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21497  Summary:
21498  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21499  module.
21500  Description:
21501  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21502  available on the Ports module.
21503  When this function returns true, these functions are supported on the device:
21504  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21505  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21506  Preconditions:
21507  None.
21508  Parameters:
21509  index - Identifier for the device instance
21510  Returns:
21511  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21512  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21513  Remarks:
21514  None.
21515 */
21516 
21517 bool
21519  PORTS_MODULE_ID index ) ;
21520 //******************************************************************************
21521 /* Function:
21522  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21523  Summary:
21524  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21525  module.
21526  Description:
21527  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21528  available on the Ports module.
21529  When this function returns true, these functions are supported on the device:
21530  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21531  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21532  Preconditions:
21533  None.
21534  Parameters:
21535  index - Identifier for the device instance
21536  Returns:
21537  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21538  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21539  Remarks:
21540  None.
21541 */
21542 
21543 bool
21545  PORTS_MODULE_ID index ) ;
21546 //******************************************************************************
21547 /* Function:
21548  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21549  Summary:
21550  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21551  module.
21552  Description:
21553  This function identifies whether the ChangeNoticePerPortStatus feature is
21554  available on the Ports module.
21555  When this function returns true, these functions are supported on the device:
21556  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21557  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21558  Preconditions:
21559  None.
21560  Parameters:
21561  index - Identifier for the device instance
21562  Returns:
21563  - true - The ChangeNoticePerPortStatus feature is supported on the device
21564  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21565  Remarks:
21566  None.
21567 */
21568 
21569 bool
21571  PORTS_MODULE_ID index ) ;
21572 //******************************************************************************
21573 /* Function:
21574  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21575  Summary:
21576  Identifies whether the SlewRateControl feature exists on the Ports module.
21577  Description:
21578  This function identifies whether the SlewRateControl feature is available
21579  on the Ports module.
21580  When this function returns true, these functions are supported on the device:
21581  - PLIB_PORTS_ChannelSlewRateSelect
21582  - PLIB_PORTS_PinSlewRateGet
21583  Preconditions:
21584  None.
21585  Parameters:
21586  index - Identifier for the device instance
21587  Returns:
21588  - true - The SlewRateControl feature is supported on the device
21589  - false - The SlewRateControl feature is not supported on the device
21590  Remarks:
21591  None.
21592 */
21593 
21594 bool
21596  PORTS_MODULE_ID index ) ;
21597 //******************************************************************************
21598 /* Function:
21599  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21600  Summary:
21601  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21602  Ports module.
21603  Description:
21604  This function identifies whether the ChannelChangeNoticeMethod feature is
21605  available on the Ports module.
21606  When this function returns true, these functions are supported on the device:
21607  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21608  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21609  Preconditions:
21610  None.
21611  Parameters:
21612  index - Identifier for the device instance
21613  Returns:
21614  - true - The ChannelChangeNoticeMethod feature is supported on the device
21615  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21616  Remarks:
21617  None.
21618 */
21619 
21620 bool
21622  PORTS_MODULE_ID index ) ;
21623 //******************************************************************************
21624 /* Function:
21625  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21626  Summary:
21627  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21628  module.
21629  Description:
21630  This function identifies whether the ChangeNoticeEdgeControl feature is
21631  available on the Ports module.
21632  When this function returns true, these functions are supported on the device:
21633  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21634  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21635  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21636  Preconditions:
21637  None.
21638  Parameters:
21639  index - Identifier for the device instance
21640  Returns:
21641  - true - The ChangeNoticeEdgeControl feature is supported on the device
21642  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21643  Remarks:
21644  None.
21645 */
21646 
21647 bool
21649  PORTS_MODULE_ID index ) ;
21650 //******************************************************************************
21651 /* Function:
21652  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21653  Summary:
21654  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21655  module.
21656  Description:
21657  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21658  on the Ports module.
21659  When this function returns true, this function is supported on the device:
21660  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21661  Preconditions:
21662  None.
21663  Parameters:
21664  index - Identifier for the device instance
21665  Returns:
21666  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21667  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21668  Remarks:
21669  None.
21670 */
21671 
21672 bool
21674  PORTS_MODULE_ID index ) ;
21675 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21676 /*******************************************************************************
21677  Ports Peripheral Library Compatibility Header
21678  Company:
21679  Microchip Technology Inc.
21680  File Name:
21681  plib_ports_compatibility.h
21682  Summary:
21683  Ports Peripheral Library Interface header for backward compatibility.
21684  Description:
21685  This header file contains the definitions of the functions which are
21686  supported for backward compatibility only. These will be deprecated later.
21687 *******************************************************************************/
21688 // DOM-IGNORE-BEGIN
21689 /*******************************************************************************
21690 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21691 Microchip licenses to you the right to use, modify, copy and distribute
21692 Software only when embedded on a Microchip microcontroller or digital signal
21693 controller that is integrated into your product or third party product
21694 (pursuant to the sublicense terms in the accompanying license agreement).
21695 You should refer to the license agreement accompanying this Software for
21696 additional information regarding your rights and obligations.
21697 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21698 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21699 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21700 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21701 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21702 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21703 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21704 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21705 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21706 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21707 *******************************************************************************/
21708 // DOM-IGNORE-END
21709 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21710 #define _PLIB_PORTS_COMPATIBILITY_H
21711 #include <stdint.h>
21712 #include <stddef.h>
21713 // *****************************************************************************
21714 /* Function:
21715  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21716  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21717  Summary:
21718  checks the status of change on the pin
21719  Description:
21720  This function checks if the change has occurred on the given pin or not.
21721  Precondition:
21722  None.
21723  Parameters:
21724  index - Identifier for the device instance to be configured
21725  channel - Port pin channel
21726  bitPos - Position in the PORT pins
21727  Returns:
21728  None.
21729  Example:
21730  <code>
21731 
21732  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21733  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21734  {
21735  //do something
21736  }
21737 
21738  </code>
21739  Remarks:
21740  This feature may not be available on all devices. Please refer to the
21741  specific device data sheet to determine availability or use
21742  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21743  whether this feature is available.
21744 
21745  This function will be deprecated later.
21746 */
21747 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21748  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21749 /*******************************************************************************
21750  End of File
21751 */
21752 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21753 /* CLOSE_FILE Include File */
21754 
21755 //DOM-IGNORE-BEGIN
21756 //DOM-IGNORE-END
21757  // #ifndef _PLIB_PORTS_H
21758 /*******************************************************************************
21759  End of File
21760 */
21761 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21762 /* CLOSE_FILE Include File */
21763 
21764 #include "system/int/sys_int.h"
21765 // *****************************************************************************
21766 // *****************************************************************************
21767 // Section: SYS PORTS Data Types
21768 // *****************************************************************************
21769 // *****************************************************************************
21770 // *****************************************************************************
21771 /* SYS PORTS PULLUP status
21772  Summary:
21773  Provides the pull-up and pull-down status.
21774  Description:
21775  These constants provide the pull-up or pull-down status definitions.
21776  Remarks:
21777  None.
21778 */
21779 
21780 typedef
21781  enum
21782  {
21783  /* PULLUP Disable */
21785  /*DOM-IGNORE-BEGIN*/
21786  = 0 /*DOM-IGNORE-END*/
21787  ,
21788  /* PULLUP Enable */
21790  /*DOM-IGNORE-BEGIN*/
21791  = 1 /*DOM-IGNORE-END*/
21792  ,
21794 // *****************************************************************************
21795 /* SYS PORTS PIN DIRECTION
21796  Summary:
21797  Defines the direction of the port pins.
21798  Description:
21799  These constants provide the port pin direction definitions.
21800  Remarks:
21801  None.
21802 */
21803 
21804 typedef
21805  enum
21806  {
21807  /* Direction as output */
21809  /*DOM-IGNORE-BEGIN*/
21810  = 0 /*DOM-IGNORE-END*/
21811  ,
21812  /* Direction as input */
21814  /*DOM-IGNORE-BEGIN*/
21815  = 1 /*DOM-IGNORE-END*/
21816  ,
21818 
21819 typedef
21820  enum
21821  {
21824  // #ifndef _SYS_PORTS_DEFINITIONS_H
21825 /*******************************************************************************
21826  End of File
21827 */
21828 
21829 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21830 /* CLOSE_FILE Include File */
21831 
21832 // DOM-IGNORE-BEGIN
21833 // DOM-IGNORE-END
21834 // *****************************************************************************
21835 // *****************************************************************************
21836 // Section: SYS PorTS Module Initialization Routine
21837 // *****************************************************************************
21838 // *****************************************************************************
21839 // *****************************************************************************
21840 /* Function:
21841  void SYS_PORTS_Initialize()
21842  Summary:
21843  Initializes PORT Pins/Channels.
21844  <p><b>Implementation:</b> Static/Dynamic</p>
21845  Description:
21846  This function initializes different port pins/channels to the desired state.
21847  It also remaps the pins to the desired specific function.
21848  Precondition:
21849  None.
21850  Parameters:
21851  None.
21852  Returns:
21853  None.
21854  Example:
21855  <code>
21856  SYS_PORTS_Initialize();
21857  </code>
21858  Remarks:
21859  This API must be be called at the time of system initialization to
21860  initialize the ports pins.
21861 */
21862 
21863 void
21865 // *****************************************************************************
21866 // *****************************************************************************
21867 // Section: SYS PORTS CONTROL Routines
21868 // *****************************************************************************
21869 // *****************************************************************************
21870 // *****************************************************************************
21871 /* Function:
21872  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21873  Summary:
21874  Reads the data from the I/O port.
21875  <p><b>Implementation:</b> Dynamic</p>
21876  Description:
21877  This function reads the data from the I/O port.
21878  Preconditions:
21879  The direction of the port to be set as input.
21880  Parameters:
21881  index - Identifier for the device instance to be configured
21882  channel - Identifier for the PORT channel: A, B, C, etc.
21883  Returns:
21884  Returns the data read from the port.
21885  Example:
21886  <code>
21887  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21888  // application developer.
21889  PORTS_DATA_TYPE readData;
21890  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21891  </code>
21892  Remarks:
21893  None.
21894 */
21895 
21897  SYS_PORTS_Read (
21898  PORTS_MODULE_ID index ,
21899  PORTS_CHANNEL channel ) ;
21900 // *****************************************************************************
21901 /* Function:
21902  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21903  PORTS_CHANNEL channel,
21904  PORTS_DATA_TYPE value )
21905  Summary:
21906  Writes the data to the I/O port.
21907  <p><b>Implementation:</b> Dynamic</p>
21908  Description:
21909  This function writes the data to the I/O port.
21910  Preconditions:
21911  The direction of the port to be set as output.
21912  Parameters:
21913  index - Identifier for the device instance to be configured
21914  channel - Identifier for the PORT channel: A, B, C, etc.
21915  value - Value to be written into a port of width PORTS_DATA_TYPE
21916  Returns:
21917  None.
21918  Example:
21919  <code>
21920  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21921  // application developer.
21922  PORTS_DATA_TYPE writeData;
21923  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21924  </code>
21925  Remarks:
21926  None.
21927 */
21928 
21929 void
21930  SYS_PORTS_Write (
21931  PORTS_MODULE_ID index ,
21932  PORTS_CHANNEL channel ,
21933  PORTS_DATA_TYPE value ) ;
21934 // *****************************************************************************
21935 /* Function:
21936  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21937  Summary:
21938  Reads the data driven on the I/O port.
21939  <p><b>Implementation:</b> Dynamic</p>
21940  Description:
21941  This function reads the data driven on the I/O port.
21942  Preconditions:
21943  The direction of the port to be set as output.
21944  Parameters:
21945  index - Identifier for the device instance to be configured
21946  channel - Identifier for the PORT channel: A, B, C, etc.
21947  Returns:
21948  Returns the data driven on the port.
21949  Example:
21950  <code>
21951  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21952  // application developer.
21953  PORTS_DATA_TYPE drivenData;
21954  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21955  </code>
21956  Remarks:
21957  None.
21958 */
21959 
21962  PORTS_MODULE_ID index ,
21963  PORTS_CHANNEL channel ) ;
21964 // *****************************************************************************
21965 /* Function:
21966  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21967  PORTS_DATA_TYPE value,
21968  PORTS_DATA_MASK mask )
21969  Summary:
21970  Sets the selected digital port/latch based on the mask.
21971  <p><b>Implementation:</b> Dynamic</p>
21972  Description:
21973  This function Sets the selected digital port/latch relative to the mask.
21974  This function "AND" value and mask parameters and then set the bits
21975  in the port channel that were set in the result of the ANDing operation.
21976  Preconditions:
21977  None.
21978  Parameters:
21979  index - Identifier for the device instance to be configured
21980  channel - Identifier for the PORT channel: A, B, C, etc.
21981  value - Consists of information about which port bit has to be set
21982  mask - Identifies the bits which could be intended for setting
21983  Returns:
21984  None.
21985  Example:
21986  <code>
21987  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21988  // application developer.
21989  // MY_VALUE - 0x1234
21990  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21991  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21992  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21993  </code>
21994  Remarks:
21995  Not all features are available on all devices. Refer to the specific device
21996  data sheet for availability.
21997 */
21998 
21999 void
22000  SYS_PORTS_Set (
22001  PORTS_MODULE_ID index ,
22002  PORTS_CHANNEL channel ,
22003  PORTS_DATA_TYPE value ,
22004  PORTS_DATA_MASK mask ) ;
22005 // *****************************************************************************
22006 /* Function:
22007  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22008  PORTS_DATA_MASK clearMask )
22009  Summary:
22010  Clears the selected digital port.
22011  <p><b>Implementation:</b> Dynamic</p>
22012  Description:
22013  This function clears the selected digital port.
22014  Preconditions:
22015  None.
22016  Parameters:
22017  index - Identifier for the device instance to be configured
22018  channel - Identifier for the PORT channel: A, B, C, etc.
22019  clearMask - Identifies the bits to be cleared
22020  Returns:
22021  None.
22022  Example:
22023  <code>
22024  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22025  // application developer.
22026  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22027  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22028  </code>
22029  Remarks:
22030  Not all features are available on all devices. Refer to the specific device
22031  data sheet for availability.
22032 */
22033 
22034 void
22035  SYS_PORTS_Clear (
22036  PORTS_MODULE_ID index ,
22037  PORTS_CHANNEL channel ,
22038  PORTS_DATA_MASK clearMask ) ;
22039 // *****************************************************************************
22040 /* Function:
22041  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22042  SYS_PORTS_PIN_DIRECTION pinDir,
22043  PORTS_CHANNEL channel,
22044  PORTS_DATA_MASK mask )
22045  Summary:
22046  Enables the direction for the selected port.
22047  <p><b>Implementation:</b> Dynamic</p>
22048  Description:
22049  This function enables the direction for the selected port.
22050  Preconditions:
22051  None.
22052  Parameters:
22053  index - Identifier for the device instance to be configured
22054  pinDir - Pin direction
22055  channel - Identifier for the PORT channel: A, B, C, etc.
22056  mask - Mask for the direction of width PORTS_DATA_MASK
22057  Returns:
22058  None
22059  Example:
22060  <code>
22061  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22062  // application developer.
22063  SYS_PORTS_PIN_DIRECTION pinDir;
22064  pinDir = SYS_PORTS_DIRECTION_INPUT;
22065  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22066  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22067  </code>
22068  Remarks:
22069  None.
22070 */
22071 
22072 void
22074  PORTS_MODULE_ID index ,
22075  SYS_PORTS_PIN_DIRECTION pinDir ,
22076  PORTS_CHANNEL channel ,
22077  PORTS_DATA_MASK mask ) ;
22078 // *****************************************************************************
22079 /* Function:
22080  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22081  Summary:
22082  Reads the direction for the selected port.
22083  <p><b>Implementation:</b> Dynamic</p>
22084  Description:
22085  This function reads the direction for the selected port.
22086  Preconditions:
22087  None.
22088  Parameters:
22089  index - Identifier for the device instance to be configured
22090  channel - Identifier for the PORT channel: A, B, C, etc.
22091  Returns:
22092  Direction of the port.
22093  Example:
22094  <code>
22095  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22096  // application developer.
22097  PORTS_DATA_MASK value;
22098  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22099  </code>
22100  Remarks:
22101  None.
22102 */
22103 
22106  PORTS_MODULE_ID index ,
22107  PORTS_CHANNEL channel ) ;
22108 // *****************************************************************************
22109 /* Function:
22110  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22111  PORTS_DATA_MASK toggleMask )
22112  Summary:
22113  Toggles the selected digital port pins.
22114  <p><b>Implementation:</b> Dynamic</p>
22115  Description:
22116  This function toggles the selected digital port pins.
22117  Preconditions:
22118  None.
22119  Parameters:
22120  index - Identifier for the device instance to be configured
22121  channel - Identifier for the PORT channel: A, B, C, etc.
22122  toggleMask - Identifies the bits to be toggled
22123  Returns:
22124  None.
22125  Example:
22126  <code>
22127  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22128  // application developer.
22129  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22130  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22131  </code>
22132  Remarks:
22133  None.
22134 */
22135 
22136 void
22138  PORTS_MODULE_ID index ,
22139  PORTS_CHANNEL channel ,
22140  PORTS_DATA_MASK toggleMask ) ;
22141 // *****************************************************************************
22142 /* Function:
22143  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22144  PORTS_DATA_MASK mask )
22145  Summary:
22146  Enables the open-drain functionality for the selected port.
22147  <p><b>Implementation:</b> Dynamic</p>
22148  Description:
22149  This function enables the open-drain functionality for the selected port.
22150  Preconditions:
22151  None.
22152  Parameters:
22153  index - Identifier for the device instance to be configured
22154  channel - Identifier for the PORT channel: A, B, C, etc.
22155  mask - Mask of type PORTS_DATA_MASK
22156  Returns:
22157  None.
22158  Example:
22159  <code>
22160  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22161  // application developer.
22162  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22163  </code>
22164  Remarks:
22165  Not all features are available on all devices. Refer to the specific device
22166  data sheet for availability.
22167 */
22168 
22169 void
22171  PORTS_MODULE_ID index ,
22172  PORTS_CHANNEL channel ,
22173  PORTS_DATA_MASK mask ) ;
22174 // *****************************************************************************
22175 /* Function:
22176  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22177  PORTS_DATA_MASK mask )
22178  Summary:
22179  Disables the open-drain functionality for the selected port.
22180  <p><b>Implementation:</b> Dynamic</p>
22181  Description:
22182  This function disables the open-drain functionality for the selected port.
22183  Preconditions:
22184  None.
22185  Parameters:
22186  index - Identifier for the device instance to be configured
22187  channel - Identifier for the PORT channel: A, B, C, etc.
22188  mask - Mask of type PORTS_DATA_MASK
22189  Returns:
22190  None.
22191  Example:
22192  <code>
22193  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22194  // application developer.
22195  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22196  </code>
22197  Remarks:
22198  Not all features are available on all devices. Refer to the specific device
22199  data sheet for availability.
22200 */
22201 
22202 void
22204  PORTS_MODULE_ID index ,
22205  PORTS_CHANNEL channel ,
22206  PORTS_DATA_MASK mask ) ;
22207 // *****************************************************************************
22208 /* Function:
22209  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22210  (
22211  PORTS_MODULE_ID index,
22212  PORTS_CHANNEL channel
22213  )
22214  Summary:
22215  Reads the interrupt status from the I/O port.
22216  <p><b>Implementation:</b> Dynamic</p>
22217  Description:
22218  This function reads the interrupt status from the I/O port.
22219  Preconditions:
22220  The interrupts should have been configured.
22221  Parameters:
22222  index - Identifier for the device instance to be configured
22223  channel - Identifier for the PORT channel: A, B, C, etc.
22224  Returns:
22225  Returns the interrupt status of the port channel.
22226  Example:
22227  <code>
22228  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22229  // application developer.
22230  PORTS_DATA_TYPE channelStatus;
22231  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22232  </code>
22233  Remarks:
22234  None.
22235 */
22236 
22239  PORTS_MODULE_ID index ,
22240  PORTS_CHANNEL channel ) ;
22241 // *****************************************************************************
22242 // *****************************************************************************
22243 // Section: SYS PORT PINS REMAPING Routines
22244 // *****************************************************************************
22245 // *****************************************************************************
22246 // *****************************************************************************
22247 /* Function:
22248  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22249  PORTS_REMAP_INPUT_FUNCTION function,
22250  PORTS_REMAP_INPUT_PIN remapPin )
22251  Summary:
22252  Input/Output (I/O) function remapping.
22253  <p><b>Implementation:</b> Dynamic</p>
22254  Description:
22255  This function controls the I/O function remapping.
22256  Precondition:
22257  None.
22258  Parameters:
22259  index - Identifier for the device instance to be configured
22260  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22261  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22262  Returns:
22263  None.
22264  Example:
22265  <code>
22266  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22267  // application developer.
22268  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22269  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22270  </code>
22271  Remarks:
22272  This feature may not be available on all devices. Please refer to the
22273  specific device data sheet to determine availability or use
22274  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22275  this feature is available.
22276 */
22277 
22278 void
22280  PORTS_MODULE_ID index ,
22281  PORTS_REMAP_INPUT_FUNCTION function ,
22282  PORTS_REMAP_INPUT_PIN remapPin ) ;
22283 // *****************************************************************************
22284 /* Function:
22285  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22286  PORTS_REMAP_OUTPUT_FUNCTION function,
22287  PORTS_REMAP_OUTPUT_PIN remapPin )
22288  Summary:
22289  Input/Output (I/O) function remapping.
22290  <p><b>Implementation:</b> Dynamic</p>
22291  Description:
22292  This function controls the I/O function remapping.
22293  Precondition:
22294  None.
22295  Parameters:
22296  index - Identifier for the device instance to be configured
22297  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22298  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22299  Returns:
22300  None.
22301  Example:
22302  <code>
22303  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22304  // application developer.
22305  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22306  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22307  </code>
22308  Remarks:
22309  This feature may not be available on all devices. Please refer to the
22310  specific device data sheet to determine availability or use
22311  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22312  this feature is available.
22313 */
22314 
22315 void
22317  PORTS_MODULE_ID index ,
22318  PORTS_REMAP_OUTPUT_FUNCTION function ,
22319  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22320 // *****************************************************************************
22321 // *****************************************************************************
22322 // Section: SYS Change Notification Pins Routines
22323 // *****************************************************************************
22324 // *****************************************************************************
22325 // *****************************************************************************
22326 /* Function:
22327  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22328  Summary:
22329  Globally enables the change notification for the selected port.
22330  <p><b>Implementation:</b> Dynamic</p>
22331  Description:
22332  This function globally enables the change notification for the selected port.
22333  Preconditions:
22334  None.
22335  Parameters:
22336  None.
22337  Returns:
22338  None.
22339  Example:
22340  <code>
22341  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22342  // application developer.
22343  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22344  </code>
22345  Remarks:
22346  Not all features are available on all devices. Refer to the specific device
22347  data sheet for availability.
22348 */
22349 
22350 void
22352  PORTS_MODULE_ID index ) ;
22353 // *****************************************************************************
22354 /* Function:
22355  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22356  Summary:
22357  Globally disables the change notification for the selected port.
22358  <p><b>Implementation:</b> Dynamic</p>
22359  Description:
22360  This function globally disables the change notification for the selected port.
22361  Preconditions:
22362  None.
22363  Parameters:
22364  None.
22365  Returns:
22366  None.
22367  Example:
22368  <code>
22369  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22370  // application developer.
22371  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22372  </code>
22373  Remarks:
22374  Not all features are available on all devices. Refer to the specific device
22375  data sheet for availability.
22376 */
22377 
22378 void
22380  PORTS_MODULE_ID index ) ;
22381 // *****************************************************************************
22382 /* Function:
22383  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22384  PORTS_CHANGE_NOTICE_PIN pinNum,
22385  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22386  Summary:
22387  Enables the change notification for the selected port.
22388  <p><b>Implementation:</b> Dynamic</p>
22389  Description:
22390  This function enables the change notification for the selected port.
22391  Preconditions:
22392  None.
22393  Parameters:
22394  index - Identifier for the device instance to be configured
22395  value - Pull-up enable or disable value
22396  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22397  Returns:
22398  None.
22399  Example:
22400  <code>
22401  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22402  // application developer.
22403  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22404  PORTS_CHANGE_NOTICE_PIN pinNum;
22405  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22406  </code>
22407  Remarks:
22408  Not all features are available on all devices. Refer to the specific device
22409  data sheet for availability.
22410 */
22411 
22412 void
22414  PORTS_MODULE_ID index ,
22415  PORTS_CHANGE_NOTICE_PIN pinNum ,
22417 // *****************************************************************************
22418 /* Function:
22419  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22420  PORTS_CHANGE_NOTICE_PIN pinNum )
22421  Summary:
22422  Disables the change notification for the selected port.
22423  <p><b>Implementation:</b> Dynamic</p>
22424  Description:
22425  This function disables the change notification for the selected port.
22426  Preconditions:
22427  None.
22428  Parameters:
22429  index - Identifier for the device instance to be configured
22430  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22431  Returns:
22432  None.
22433  Example:
22434  <code>
22435  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22436  // application developer.
22437  PORTS_CHANGE_NOTICE_PIN pinNum;
22438  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22439  </code>
22440  Remarks:
22441  Not all features are available on all devices. Refer to the specific device
22442  data sheet for availability.
22443 */
22444 
22445 void
22447  PORTS_MODULE_ID index ,
22448  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22449 // *****************************************************************************
22450 /* Function:
22451  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22452  Summary:
22453  Enables the change notification for the selected port in Sleep or Idle mode.
22454  <p><b>Implementation:</b> Dynamic</p>
22455  Description:
22456  This function enables the change notification for the selected port in Sleep
22457  or Idle mode.
22458  Preconditions:
22459  None.
22460  Parameters:
22461  None.
22462  Returns:
22463  None.
22464  Example:
22465  <code>
22466  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22467  // application developer.
22468  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22469  </code>
22470  Remarks:
22471  Not all features are available on all devices. Refer to the specific device
22472  data sheet for availability.
22473 */
22474 
22475 void
22477  PORTS_MODULE_ID index ) ;
22478 // *****************************************************************************
22479 /* Function:
22480  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22481  Summary:
22482  Disables the change notification for the selected port in Sleep or Idle mode.
22483  <p><b>Implementation:</b> Dynamic</p>
22484  Description:
22485  This function disables the change notification for the selected port in Sleep
22486  or Idle mode.
22487  Preconditions:
22488  None.
22489  Parameters:
22490  None.
22491  Returns:
22492  None.
22493  Example:
22494  <code>
22495  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22496  // application developer.
22497  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22498  </code>
22499  Remarks:
22500  Not all features are available on all devices. Refer to the specific device
22501  data sheet for availability.
22502 */
22503 
22504 void
22506  PORTS_MODULE_ID index ) ;
22507 // *****************************************************************************
22508 /* Function:
22509  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22510  PORTS_CHANGE_NOTICE_PIN pinNum )
22511  Summary:
22512  Enables a weak pull-up on the change notification pin.
22513  <p><b>Implementation:</b> Dynamic</p>
22514  Description:
22515  This function enables a weak pull-up on the change notification pin.
22516  Preconditions:
22517  None.
22518  Parameters:
22519  index - Identifier for the device instance to be configured
22520  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22521  Returns:
22522  None.
22523  Example:
22524  <code>
22525  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22526  // application developer.
22527  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22528  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22529  </code>
22530  Remarks:
22531  Not all features are available on all devices. Refer to the specific device
22532  data sheet for availability.
22533 */
22534 
22535 void
22537  PORTS_MODULE_ID index ,
22538  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22539 // *****************************************************************************
22540 /* Function:
22541  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22542  PORTS_CHANGE_NOTICE_PIN pinNum )
22543  Summary:
22544  Disables a weak pull-up on the change notification pin.
22545  <p><b>Implementation:</b> Dynamic</p>
22546  Description:
22547  This function Disables a weak pull-up on the change notification pin.
22548  Preconditions:
22549  None.
22550  Parameters:
22551  index - Identifier for the device instance to be configured
22552  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22553  Returns:
22554  None.
22555  Example:
22556  <code>
22557  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22558  // application developer.
22559  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22560  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22561  </code>
22562  Remarks:
22563  Not all features are available on all devices. Refer to the specific device
22564  data sheet for availability.
22565 */
22566 
22567 void
22569  PORTS_MODULE_ID index ,
22570  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22571 // *****************************************************************************
22572 // *****************************************************************************
22573 // Section: SYS PORT PINS Control Routines
22574 // *****************************************************************************
22575 // *****************************************************************************
22576 // *****************************************************************************
22577 /* Function:
22578  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22579  PORTS_ANALOG_PIN pin,
22580  PORTS_PIN_MODE mode)
22581  Summary:
22582  Enables the selected pin as analog or digital.
22583  <p><b>Implementation:</b> Dynamic</p>
22584  Description:
22585  This function enables the selected pin as analog or digital.
22586  Preconditions:
22587  None.
22588  Parameters:
22589  index - Identifier for the device instance to be configured
22590  pin - Possible values of PORTS_ANALOG_PIN
22591  mode - Possible values of PORTS_PIN_MODE
22592  Returns:
22593  None.
22594  Example:
22595  <code>
22596  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22597  // application developer.
22598  // MY_PIN - PORTS_ANALOG_PIN_AN0
22599  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22600  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22601  </code>
22602  Remarks:
22603  Not all features are available on all devices. Refer to the specific device
22604  data sheet for availability.
22605 */
22606 
22607 void
22609  PORTS_MODULE_ID index ,
22610  PORTS_ANALOG_PIN pin ,
22611  PORTS_PIN_MODE mode ) ;
22612 // *****************************************************************************
22613 /* Function:
22614  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22615  PORTS_CHANNEL channel,
22616  PORTS_BIT_POS bitPos
22617  bool value )
22618  Summary:
22619  Writes the selected digital pin.
22620  <p><b>Implementation:</b> Dynamic</p>
22621  Description:
22622  This function writes the selected digital pin.
22623  Preconditions:
22624  None.
22625  Parameters:
22626  index - Identifier for the device instance to be configured
22627  channel - Identifier for the PORT channel: A, B, C, etc.
22628  bitPos - Possible values of PORTS_BIT_POS
22629  value - Value to be written to the specific pin/latch:
22630  - true - Sets the bit
22631  - false - Clears the bit
22632  Returns:
22633  None.
22634  Example:
22635  <code>
22636  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22637  // application developer.
22638  // MY_PINNUM - PORTS_PIN_10
22639  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22640  </code>
22641  Remarks:
22642  Not all features are available on all devices. Refer to the specific device
22643  data sheet for availability.
22644 */
22645 
22646 void
22648  PORTS_MODULE_ID index ,
22649  PORTS_CHANNEL channel ,
22650  PORTS_BIT_POS bitPos ,
22651  bool value ) ;
22652 // *****************************************************************************
22653 /* Function:
22654  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22655  PORTS_CHANNEL channel,
22656  PORTS_BIT_POS bitPos )
22657  Summary:
22658  Reads the data driven on the selected digital pin.
22659  <p><b>Implementation:</b> Dynamic</p>
22660  Description:
22661  This function reads the data driven on the selected
22662  digital output pin.
22663  Preconditions:
22664  None.
22665  Parameters:
22666  index - Identifier for the device instance to be configured
22667  channel - Identifier for the PORT channel: A, B, C, etc.
22668  bitPos - Possible values of PORTS_BIT_POS
22669  Returns:
22670  The status of the data driven on the port pin.
22671  Example:
22672  <code>
22673  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22674  // application developer.
22675  // MY_PINNUM - PORTS_PIN_10
22676  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22677  </code>
22678  Remarks:
22679  Not all features are available on all devices. Refer to the specific device
22680  data sheet for availability.
22681 */
22682 
22683 bool
22685  PORTS_MODULE_ID index ,
22686  PORTS_CHANNEL channel ,
22687  PORTS_BIT_POS bitPos ) ;
22688 // *****************************************************************************
22689 /* Function:
22690  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22691  PORTS_CHANNEL channel,
22692  PORTS_BIT_POS bitPos )
22693  Summary:
22694  Reads the selected digital pin.
22695  <p><b>Implementation:</b> Dynamic</p>
22696  Description:
22697  This function reads the selected digital pin, not the Latch.
22698  Preconditions:
22699  None.
22700  Parameters:
22701  index - Identifier for the device instance to be configured
22702  channel - Identifier for the PORT channel: A, B, C, etc.
22703  bitPos - Possible values of PORTS_BIT_POS
22704  Returns:
22705  The status of the port pin.
22706  Example:
22707  <code>
22708  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22709  // application developer.
22710  // MY_PINNUM - PORTS_PIN_10
22711  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22712  </code>
22713  Remarks:
22714  Not all features are available on all devices. Refer to the specific device
22715  data sheet for availability.
22716 */
22717 
22718 bool
22720  PORTS_MODULE_ID index ,
22721  PORTS_CHANNEL channel ,
22722  PORTS_BIT_POS bitPos ) ;
22723 // *****************************************************************************
22724 /* Function:
22725  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22726  PORTS_CHANNEL channel,
22727  PORTS_BIT_POS bitPos )
22728  Summary:
22729  Toggles the selected digital pin.
22730  <p><b>Implementation:</b> Dynamic</p>
22731  Description:
22732  This function toggles the selected digital pin.
22733  Preconditions:
22734  None.
22735  Parameters:
22736  index - Identifier for the device instance to be configured
22737  channel - Identifier for the PORT channel: A, B, C, etc.
22738  bitPos - Possible values of PORTS_BIT_POS
22739  Returns:
22740  None.
22741  Example:
22742  <code>
22743  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22744  // application developer.
22745  // MY_PINNUM - PORTS_PIN_10
22746  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22747  </code>
22748  Remarks:
22749  Not all features are available on all devices. Refer to the specific device
22750  data sheet for availability.
22751 */
22752 
22753 void
22755  PORTS_MODULE_ID index ,
22756  PORTS_CHANNEL channel ,
22757  PORTS_BIT_POS bitPos ) ;
22758 // *****************************************************************************
22759 /* Function:
22760  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22761  PORTS_CHANNEL channel,
22762  PORTS_BIT_POS bitPos )
22763  Summary:
22764  Sets the selected digital pin/latch.
22765  <p><b>Implementation:</b> Dynamic</p>
22766  Description:
22767  This function sets the selected digital pin/latch.
22768  Preconditions:
22769  None.
22770  Parameters:
22771  index - Identifier for the device instance to be configured
22772  channel - Identifier for the PORT channel: A, B, C, etc.
22773  bitPos - Possible values of PORTS_BIT_POS
22774  Returns:
22775  None.
22776  Example:
22777  <code>
22778  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22779  // application developer.
22780  // MY_PINNUM - PORTS_PIN_10
22781  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22782  </code>
22783  Remarks:
22784  Not all features are available on all devices. Refer to the specific device
22785  data sheet for availability.
22786 */
22787 
22788 void
22790  PORTS_MODULE_ID index ,
22791  PORTS_CHANNEL channel ,
22792  PORTS_BIT_POS bitPos ) ;
22793 // *****************************************************************************
22794 /* Function:
22795  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22796  PORTS_CHANNEL channel,
22797  PORTS_BIT_POS bitPos )
22798  Summary:
22799  Clears the selected digital pin.
22800  <p><b>Implementation:</b> Dynamic</p>
22801  Description:
22802  This function clears the selected digital pin.
22803  Preconditions:
22804  None.
22805  Parameters:
22806  index - Identifier for the device instance to be configured
22807  channel - Identifier for the PORT channel: A, B, C, etc.
22808  bitPos - Possible values of PORTS_BIT_POS
22809  Returns:
22810  None.
22811  Example:
22812  <code>
22813  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22814  // application developer.
22815  // MY_PINNUM - PORTS_IO_PIN_10
22816  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22817  </code>
22818  Remarks:
22819  Not all features are available on all devices. Refer to the specific device
22820  data sheet for availability.
22821 */
22822 
22823 void
22825  PORTS_MODULE_ID index ,
22826  PORTS_CHANNEL channel ,
22827  PORTS_BIT_POS bitPos ) ;
22828 // *****************************************************************************
22829 /* Function:
22830  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22831  SYS_PORTS_PIN_DIRECTION pinDir,
22832  PORTS_CHANNEL channel,
22833  PORTS_BIT_POS bitPos )
22834  Summary:
22835  Enables the direction for the selected pin.
22836  <p><b>Implementation:</b> Dynamic</p>
22837  Description:
22838  This function enables the direction for the selected pin.
22839  Preconditions:
22840  None.
22841  Parameters:
22842  index - Identifier for the device instance to be configured
22843  pinDir - Pin direction
22844  channel - Identifier for the PORT channel: A, B, C, etc.
22845  bitPos - Possible values of PORTS_BIT_POS
22846  Returns:
22847  None.
22848  Example:
22849  <code>
22850  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22851  // application developer.
22852  // MY_PINNUM - PORTS_PIN_10
22853  SYS_PORTS_PIN_DIRECTION pinDir;
22854  pinDir = SYS_PORTS_DIRECTION_INPUT;
22855  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22856  </code>
22857  Remarks:
22858  Not all features are available on all devices. Refer to the specific device
22859  data sheet for availability.
22860 */
22861 
22862 void
22864  PORTS_MODULE_ID index ,
22865  SYS_PORTS_PIN_DIRECTION pinDir ,
22866  PORTS_CHANNEL channel ,
22867  PORTS_BIT_POS bitPos ) ;
22868 // *****************************************************************************
22869 /* Function:
22870  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22871  PORTS_CHANNEL channel,
22872  PORTS_BIT_POS bitPos )
22873  Summary:
22874  Enables the open-drain functionality for the selected pin.
22875  <p><b>Implementation:</b> Dynamic</p>
22876  Description:
22877  This function enables the open-drain functionality for the selected pin.
22878  Preconditions:
22879  None.
22880  Parameters:
22881  index - Identifier for the device instance to be configured
22882  channel - Identifier for the PORT channel: A, B, C, etc.
22883  bitPos - Possible values of PORTS_BIT_POS
22884  Returns:
22885  None.
22886  Example:
22887  <code>
22888  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22889  // application developer.
22890  // MY_PINNUM - PORTS_PIN_10
22891  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22892  </code>
22893  Remarks:
22894  Not all features are available on all devices. Refer to the specific device
22895  data sheet for availability.
22896 */
22897 
22898 void
22900  PORTS_MODULE_ID index ,
22901  PORTS_CHANNEL channel ,
22902  PORTS_BIT_POS bitPos ) ;
22903 // *****************************************************************************
22904 /* Function:
22905  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22906  PORTS_CHANNEL channel,
22907  PORTS_BIT_POS bitPos )
22908  Summary:
22909  Disables the open-drain functionality for the selected pin.
22910  <p><b>Implementation:</b> Dynamic</p>
22911  Description:
22912  This function disables the open-drain functionality for the selected pin.
22913  Preconditions:
22914  None.
22915  Parameters:
22916  index - Identifier for the device instance to be configured
22917  channel - Identifier for the PORT channel: A, B, C, etc.
22918  bitPos - Possible values of PORTS_BIT_POS
22919  Returns:
22920  None.
22921  Example:
22922  <code>
22923  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22924  // application developer.
22925  // MY_PINNUM - PORTS_PIN_10
22926  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22927  </code>
22928  Remarks:
22929  Not all features are available on all devices. Refer to the specific device
22930  data sheet for availability.
22931 */
22932 
22933 void
22935  PORTS_MODULE_ID index ,
22936  PORTS_CHANNEL channel ,
22937  PORTS_BIT_POS bitPos ) ;
22938 // *****************************************************************************
22939 /* Function:
22940  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22941  PORTS_CHANNEL channel,
22942  PORTS_BIT_POS bitPos )
22943  Summary:
22944  Enables the pull-up functionality for the selected pin.
22945  <p><b>Implementation:</b> Dynamic</p>
22946  Description:
22947  This function enables the pull-up functionality for the selected pin.
22948  Preconditions:
22949  None.
22950  Parameters:
22951  index - Identifier for the device instance to be configured
22952  channel - Identifier for the PORT channel: A, B, C, etc.
22953  bitPos - Possible values of PORTS_BIT_POS
22954  Returns:
22955  None.
22956  Example:
22957  <code>
22958  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22959  // application developer.
22960  // MY_PINNUM - PORTS_PIN_10
22961  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22962  </code>
22963  Remarks:
22964  Not all features are available on all devices. Refer to the specific device
22965  data sheet for availability.
22966 */
22967 
22968 void
22970  PORTS_MODULE_ID index ,
22971  PORTS_CHANNEL channel ,
22972  PORTS_BIT_POS bitPos ) ;
22973 // *****************************************************************************
22974 /* Function:
22975  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22976  PORTS_CHANNEL channel,
22977  PORTS_BIT_POS bitPos )
22978  Summary:
22979  Disables the pull-up functionality for the selected pin.
22980  <p><b>Implementation:</b> Dynamic</p>
22981  Description:
22982  This function disables the pull-up functionality for the selected pin.
22983  Preconditions:
22984  None.
22985  Parameters:
22986  index - Identifier for the device instance to be configured
22987  channel - Identifier for the PORT channel: A, B, C, etc.
22988  bitPos - Possible values of PORTS_BIT_POS
22989  Returns:
22990  None.
22991  Example:
22992  <code>
22993  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22994  // application developer.
22995  // MY_PINNUM - PORTS_PIN_10
22996  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22997  </code>
22998  Remarks:
22999  Not all features are available on all devices. Refer to the specific device
23000  data sheet for availability.
23001 */
23002 
23003 void
23005  PORTS_MODULE_ID index ,
23006  PORTS_CHANNEL channel ,
23007  PORTS_BIT_POS bitPos ) ;
23008 // *****************************************************************************
23009 /* Function:
23010  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23011  PORTS_CHANNEL channel,
23012  PORTS_BIT_POS bitPos )
23013  Summary:
23014  Enables the pull-down functionality for the selected pin.
23015  <p><b>Implementation:</b> Dynamic</p>
23016  Description:
23017  This function enables the pull-down functionality for the selected pin.
23018  Preconditions:
23019  None.
23020  Parameters:
23021  index - Identifier for the device instance to be configured
23022  channel - Identifier for the PORT channel: A, B, C, etc.
23023  bitPos - Possible values of PORTS_BIT_POS
23024  Returns:
23025  None.
23026  Example:
23027  <code>
23028  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23029  // application developer.
23030  // MY_PINNUM - PORTS_PIN_10
23031  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23032  </code>
23033  Remarks:
23034  Not all features are available on all devices. Refer to the specific device
23035  data sheet for availability.
23036 */
23037 
23038 void
23040  PORTS_MODULE_ID index ,
23041  PORTS_CHANNEL channel ,
23042  PORTS_BIT_POS bitPos ) ;
23043 // *****************************************************************************
23044 /* Function:
23045  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23046  PORTS_CHANNEL channel,
23047  PORTS_BIT_POS bitPos )
23048  Summary:
23049  Disables the pull-down functionality for the selected pin.
23050  <p><b>Implementation:</b> Dynamic</p>
23051  Description:
23052  This function disables the pull-down functionality for the selected pin.
23053  Preconditions:
23054  None.
23055  Parameters:
23056  index - Identifier for the device instance to be configured
23057  channel - Identifier for the PORT channel: A, B, C, etc.
23058  bitPos - Possible values of PORTS_BIT_POS
23059  Returns:
23060  None.
23061  Example:
23062  <code>
23063  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23064  // application developer.
23065  // MY_PINNUM - PORTS_PIN_10
23066  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23067  </code>
23068  Remarks:
23069  Not all features are available on all devices. Refer to the specific device
23070  data sheet for availability.
23071 */
23072 
23073 void
23075  PORTS_MODULE_ID index ,
23076  PORTS_CHANNEL channel ,
23077  PORTS_BIT_POS bitPos ) ;
23078 //******************************************************************************
23079 /* Function:
23080  void SYS_PORTS_InterruptEnable
23081  (
23082  PORTS_MODULE_ID index,
23083  PORTS_CHANNEL channel,
23084  PORTS_BIT_POS bitPos,
23085  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23086  )
23087  Summary:
23088  Enables the selected interrupt for the selected port pin.
23089  Description:
23090  This function enables the selected interrupt for the selected port pin.
23091  Preconditions:
23092  Select the pull-up or pull-down as required.
23093  Parameters:
23094  index - Identifier for the device instance to be configured
23095  channel - Identifier for the PORT channel: A, B, C, etc.
23096  bitPos - Possible values of PORTS_BIT_POS
23097  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23098  Returns:
23099  None.
23100  Example:
23101  <code>
23102  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23103  </code>
23104  Remarks:
23105  None.
23106 */
23107 
23108 void
23110  PORTS_MODULE_ID index ,
23111  PORTS_CHANNEL channel ,
23112  PORTS_BIT_POS bitPos ,
23113  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23114 //DOM-IGNORE-BEGIN
23115 //DOM-IGNORE-END
23116  //SYS_PORTS_H
23117 /*******************************************************************************
23118  End of File
23119 */
23120 
23121 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23122 /* CLOSE_FILE Include File */
23123 
23124 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23125 /*******************************************************************************
23126  SPI Driver Interface
23127  Company:
23128  Microchip Technology Inc.
23129  File Name:
23130  drv_spi.h
23131  Summary:
23132  SPI device driver interface file.
23133  Description:
23134  The SPI driver provides a simple interface to manage the SPI module.
23135  This file defines the interface definitions and prototypes for the SPI driver.
23136 *******************************************************************************/
23137 //DOM-IGNORE-BEGIN
23138 /*******************************************************************************
23139 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23140 Microchip licenses to you the right to use, modify, copy and distribute
23141 Software only when embedded on a Microchip microcontroller or digital signal
23142 controller that is integrated into your product or third party product
23143 (pursuant to the sublicense terms in the accompanying license agreement).
23144 You should refer to the license agreement accompanying this Software for
23145 additional information regarding your rights and obligations.
23146 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23147 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23148 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23149 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23150 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23151 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23152 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23153 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23154 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23155 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23156 *******************************************************************************/
23157 //DOM-IGNORE-END
23158 #ifndef _DRV_SPI_H
23159 #define _DRV_SPI_H
23160 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23161 /*******************************************************************************
23162  SPI Driver Interface
23163  Company:
23164  Microchip Technology Inc.
23165  File Name:
23166  drv_spi_definitions.h
23167  Summary:
23168  SPI device driver interface file.
23169  Description:
23170  The SPI driver provides a simple interface to manage the SPI module.
23171  This file defines the interface definitions and prototypes for the SPI
23172  driver.
23173 *******************************************************************************/
23174 //DOM-IGNORE-BEGIN
23175 /*******************************************************************************
23176 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23177 Microchip licenses to you the right to use, modify, copy and distribute
23178 Software only when embedded on a Microchip microcontroller or digital signal
23179 controller that is integrated into your product or third party product
23180 (pursuant to the sublicense terms in the accompanying license agreement).
23181 You should refer to the license agreement accompanying this Software for
23182 additional information regarding your rights and obligations.
23183 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23184 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23185 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23186 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23187 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23188 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23189 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23190 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23191 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23192 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23193 *******************************************************************************/
23194 //DOM-IGNORE-END
23195 #ifndef _DRV_SPI_DEFINITIONS_H
23196 #define _DRV_SPI_DEFINITIONS_H
23197 // *****************************************************************************
23198 // *****************************************************************************
23199 // Section: Data Types
23200 // *****************************************************************************
23201 // *****************************************************************************
23202 #include <stdint.h>
23203 #include <stdbool.h>
23204 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23205 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23206 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23207 /*******************************************************************************
23208  SPI Peripheral Library Interface Header
23209  Company:
23210  Microchip Technology Inc.
23211  File Name:
23212  plib_spi.h
23213  Summary:
23214  SPI Peripheral Library Interface Header for common definitions.
23215  Description:
23216  This header file contains the function prototypes and definitions of
23217  the data types and constants that make up the interface to the SPI
23218  PLIB.
23219  *******************************************************************************/
23220 // DOM-IGNORE-BEGIN
23221 /*******************************************************************************
23222 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23223 Microchip licenses to you the right to use, modify, copy and distribute
23224 Software only when embedded on a Microchip microcontroller or digital signal
23225 controller that is integrated into your product or third party product
23226 (pursuant to the sublicense terms in the accompanying license agreement).
23227 You should refer to the license agreement accompanying this Software for
23228 additional information regarding your rights and obligations.
23229 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23230 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23231 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23232 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23233 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23234 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23235 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23236 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23237 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23238 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23239  *******************************************************************************/
23240 // DOM-IGNORE-END
23241 #ifndef _PLIB_SPI_H
23242 #define _PLIB_SPI_H
23243 // DOM-IGNORE-BEGIN
23244 // DOM-IGNORE-END
23245 // *****************************************************************************
23246 // *****************************************************************************
23247 // Section: Included Files (continued at end of file)
23248 // *****************************************************************************
23249 // *****************************************************************************
23250 /* This section lists the other files that are included in this file. However,
23251  please see the end of the file for additional implementation header files
23252  that are also included.
23253  */
23254 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23255 //DOM-IGNORE-BEGIN
23256 /*******************************************************************************
23257 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23258 Microchip licenses to you the right to use, modify, copy and distribute
23259 Software only when embedded on a Microchip microcontroller or digital signal
23260 controller that is integrated into your product or third party product
23261 (pursuant to the sublicense terms in the accompanying license agreement).
23262 You should refer to the license agreement accompanying this Software for
23263 additional information regarding your rights and obligations.
23264 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23265 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23266 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23267 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23268 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23269 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23270 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23271 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23272 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23273 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23274  *******************************************************************************/
23275 //DOM-IGNORE-END
23276 #ifndef _PLIB_SPI_PROCESSOR_H
23277 #define _PLIB_SPI_PROCESSOR_H
23278 #error "Can't find header"
23279 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23280 /* CLOSE_FILE Include File */
23281 
23282 // *****************************************************************************
23283 // *****************************************************************************
23284 // Section: Constants & Data Types
23285 // *****************************************************************************
23286 // *****************************************************************************
23287 // *****************************************************************************
23288 // *****************************************************************************
23289 // Section: SPI Peripheral Library Interface Routines
23290 // *****************************************************************************
23291 // *****************************************************************************
23292 //******************************************************************************
23293 /* Function:
23294  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23295  Summary:
23296  Enables the SPI module.
23297  Description:
23298  This function enables the SPI module.
23299  This operation is atomic.
23300  Precondition:
23301  None.
23302  Parameters:
23303  index - Identifier for the device instance to be configured
23304  Returns:
23305  None.
23306  Example:
23307  <code>
23308  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23309  // application developer.
23310  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23311  </code>
23312  Remarks:
23313  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23314  before use.
23315  This function implements an operation of the enable control feature. This
23316  feature may not be available on all devices. Please refer to the specific
23317  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23318  in your application to automatically determine whether this feature is available.
23319  */
23320 
23321 void
23322  PLIB_SPI_Enable (
23323  SPI_MODULE_ID index ) ;
23324 //******************************************************************************
23325 /* Function:
23326  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23327  Summary:
23328  Disables the SPI module.
23329  Description:
23330  This function disables the SPI module.
23331  This operation is atomic.
23332  Precondition:
23333  None.
23334  Parameters:
23335  index - Identifier for the device instance to be configured
23336  Returns:
23337  None.
23338  Example:
23339  <code>
23340  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23341  // application developer.
23342  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23343  </code>
23344  Remarks:
23345  This function implements an operation of the enable control feature. This
23346  feature may not be available on all devices. Please refer to the specific
23347  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23348  in your application to automatically determine whether this feature is available.
23349  */
23350 
23351 void
23353  SPI_MODULE_ID index ) ;
23354 //******************************************************************************
23355 /* Function:
23356  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23357  Summary:
23358  Discontinues module operation when the device enters Idle mode.
23359  Description:
23360  This function sets up the SPI module such that module operation is disabled
23361  when the device enters Idle mode.
23362  This operation is atomic.
23363  Precondition:
23364  None.
23365  Parameters:
23366  index - Identifier for the device instance to be configured
23367  Returns:
23368  None.
23369  Example:
23370  <code>
23371  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23372  // application developer.
23373  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23374  </code>
23375  Remarks:
23376  This function implements an operation of the stop in idle control feature.
23377  This feature may not be available on all devices. Please refer to the
23378  specific device data sheet to determine availability or use
23379  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23380  determine if this feature is available.
23381  */
23382 
23383 void
23385  SPI_MODULE_ID index ) ;
23386 //******************************************************************************
23387 /* Function:
23388  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23389  Summary:
23390  Continues module operation when the device enters Idle mode.
23391  Description:
23392  This function sets up the SPI module such that module operation is continued
23393  when the device enters Idle mode.
23394  This operation is atomic.
23395  Precondition:
23396  None.
23397  Parameters:
23398  index - Identifier for the device instance to be configured
23399  Returns:
23400  None.
23401  Example:
23402  <code>
23403  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23404  // application developer.
23405  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23406  </code>
23407  Remarks:
23408  This function implements an operation of the stop in idle control feature.
23409  This feature may not be available on all devices. Please refer to the
23410  specific device data sheet to determine availability or use
23411  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23412  this feature is available.
23413  */
23414 
23415 void
23417  SPI_MODULE_ID index ) ;
23418 //******************************************************************************
23419 /* Function:
23420  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23421  Summary:
23422  Returns the current status of the SPI receiver overflow.
23423  Description:
23424  This function returns the current status of the SPI receiver overflow.
23425  This operation is atomic.
23426  Precondition:
23427  None.
23428  Parameters:
23429  index - Identifier for the device instance to be configured
23430  Returns:
23431  SPI receiver overflow status:
23432  - true - A new byte/word is completely received and discarded.
23433  The user software has not read the previous data in
23434  the SPI buffer register.
23435  - false - No Overflow has occurred
23436  Example:
23437  <code>
23438  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23439  // application developer.
23440  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23441  </code>
23442  Remarks:
23443  This function implements an operation of the receiver overflow status feature.
23444  This feature may not be available on all devices. Please refer to the
23445  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23446  in your application to automatically determine whether this feature is available.
23447  */
23448 
23449 bool
23451  SPI_MODULE_ID index ) ;
23452 //******************************************************************************
23453 /* Function:
23454  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23455  Summary:
23456  Clears the SPI receive overflow flag.
23457  Description:
23458  This function clears the SPI receive overflow flag.
23459  This operation is atomic.
23460  Precondition:
23461  None.
23462  Parameters:
23463  index - Identifier for the device instance to be configured
23464  Returns:
23465  None.
23466  Example:
23467  <code>
23468  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23469  // application developer.
23470  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23471  </code>
23472  Remarks:
23473  This function implements an operation of the receiver overflow status feature.
23474  This feature may not be available on all devices. Please refer to the
23475  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23476  in your application to automatically determine whether this feature is available.
23477  */
23478 
23479 void
23481  SPI_MODULE_ID index ) ;
23482 //******************************************************************************
23483 /* Function:
23484  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23485  Summary:
23486  Returns the current transmit buffer status of the SPI module.
23487  Description:
23488  This function returns the current transmit buffer status of the SPI module.
23489  This operation is atomic.
23490  Precondition:
23491  None.
23492  Parameters:
23493  index - Identifier for the device instance to be configured
23494  Returns:
23495  - true - Transmit not yet started, transmit buffer is full
23496  - false - Transmit started, transmit buffer is empty/not full
23497  Example:
23498  <code>
23499  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23500  // application developer.
23501  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23502  </code>
23503  Remarks:
23504  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23505  occur, loading the transmit buffer. Automatically cleared in hardware when
23506  the SPI module transfers data from the transmit buffer to the shift register.
23507  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23508  occur, loading the last available buffer. Automatically cleared in hardware
23509  when the buffer is available for writing.
23510  This function implements an operation of the transmit buffer status feature.
23511  This feature may not be available on all devices. Please refer to the
23512  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23513  in your application to automatically determine whether this feature is available.
23514  */
23515 
23516 bool
23518  SPI_MODULE_ID index ) ;
23519 //******************************************************************************
23520 /* Function:
23521  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23522  Summary:
23523  Returns the current status of the SPI receive buffer.
23524  Description:
23525  This function returns the current status of the SPI receive buffer.
23526  This operation is atomic.
23527  Precondition:
23528  None.
23529  Parameters:
23530  index - Identifier for the device instance to be configured
23531  Returns:
23532  Receiver Buffer Full Status:
23533  - true - Receive complete, receive buffer is full
23534  - false - Receive is not complete, receive buffer is empty
23535  Example:
23536  <code>
23537  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23538  // application developer.
23539  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23540  </code>
23541  Remarks:
23542  In Standard Buffer mode - automatically set in hardware when the SPI module
23543  transfers data from the shift register to the receive buffer. Automatically
23544  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23545  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23546  transfers data from the shift register to the receive buffer, filling the
23547  last unread buffer. Automatically cleared in hardware when a buffer is available
23548  for a transfer from the shift register.
23549  This function implements an operation of the receiver buffer status feature.
23550  This feature may not be available on all devices. Please refer to the
23551  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23552  in your application to automatically determine whether this feature is available.
23553  */
23554 
23555 bool
23557  SPI_MODULE_ID index ) ;
23558 //******************************************************************************
23559 /* Function:
23560  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23561  Summary:
23562  Enables the selected SPI pins.
23563  Description:
23564  This function enables the selected SPI pins.
23565  Precondition:
23566  None.
23567  Parameters:
23568  index - Identifier for the device instance to be configured
23569  pin - One of the SPI_PIN enumeration values as the SPI pin
23570  Returns:
23571  None.
23572  Example:
23573  <code>
23574  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23575  // application developer.
23576  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23577  </code>
23578  Remarks:
23579  This function implements an operation of the pin control feature.
23580  This feature may not be available on all devices. Please refer to the
23581  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23582  in your application to automatically determine whether this feature is available.
23583  */
23584 
23585 void
23587  SPI_MODULE_ID index ,
23588  SPI_PIN pin ) ;
23589 //******************************************************************************
23590 /* Function:
23591  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23592  Summary:
23593  Enables the selected SPI pins.
23594  Description:
23595  This function enables the selected SPI pins.
23596  Precondition:
23597  None.
23598  Parameters:
23599  index - Identifier for the device instance to be configured
23600  pin - One of the SPI_PIN enumeration values as the SPI pin
23601  Returns:
23602  None.
23603  Example:
23604  <code>
23605  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23606  // application developer.
23607  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23608  </code>
23609  Remarks:
23610  This function implements an operation of the pin control feature.
23611  This feature may not be available on all devices. Please refer to the
23612  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23613  in your application to automatically determine whether this feature is available.
23614  */
23615 
23616 void
23618  SPI_MODULE_ID index ,
23619  SPI_PIN pin ) ;
23620 //******************************************************************************
23621 /* Function:
23622  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23623  SPI_COMMUNICATION_WIDTH width )
23624  Summary:
23625  Selects the data width for the SPI communication.
23626  Description:
23627  This function selects the data width for the SPI communication.
23628  This operation is atomic.
23629  Precondition:
23630  None.
23631  Parameters:
23632  index - Identifier for the device instance to be configured
23633  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23634  SPI buffer width
23635  Returns:
23636  None.
23637  Example:
23638  <code>
23639  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23640  // application developer.
23641  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23642  </code>
23643  Remarks:
23644  This function implements an operation of the communication width feature.
23645  This feature may not be available on all devices. Please refer to the
23646  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23647  in your application to automatically determine whether this feature is available.
23648  */
23649 
23650 void
23652  SPI_MODULE_ID index ,
23653  SPI_COMMUNICATION_WIDTH width ) ;
23654 //******************************************************************************
23655 /* Function:
23656  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23657  SPI_AUDIO_COMMUNICATION_WIDTH width )
23658  Summary:
23659  Selects the data width for the SPI audio communication.
23660  Description:
23661  This function selects the data width for the SPI audio communication.
23662  This operation is atomic.
23663  Precondition:
23664  None.
23665  Parameters:
23666  index - Identifier for the device instance to be configured
23667  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23668  SPI buffer width
23669  Returns:
23670  None.
23671  Example:
23672  <code>
23673  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23674  // application developer.
23675  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23676  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23677  </code>
23678  Remarks:
23679  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23680  This function implements an operation of the audio communication width feature.
23681  This feature may not be available on all devices. Please refer to the
23682  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23683  in your application to automatically determine whether this feature is available.
23684  */
23685 
23686 void
23688  SPI_MODULE_ID index ,
23689  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23690 //******************************************************************************
23691 /* Function:
23692  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23693  SPI_INPUT_SAMPLING_PHASE phase)
23694  Summary:
23695  Selects the SPI data input sample phase.
23696  Description:
23697  This function selects the input sampling phase in Master mode.
23698  Precondition:
23699  None.
23700  Parameters:
23701  index - Identifier for the device instance to be configured
23702  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23703  sampling phase
23704  Returns:
23705  None.
23706  Example:
23707  <code>
23708  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23709  // application developer.
23710  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23711  </code>
23712  Remarks:
23713  This function implements an operation of the input sample phase feature.
23714  This feature may not be available on all devices. Please refer to the
23715  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23716  in your application to automatically determine whether this feature is available.
23717  */
23718 
23719 void
23721  SPI_MODULE_ID index ,
23722  SPI_INPUT_SAMPLING_PHASE phase ) ;
23723 //******************************************************************************
23724 /* Function:
23725  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23726  SPI_OUTPUT_DATA_PHASE data)
23727  Summary:
23728  Selects serial output data change.
23729  Description:
23730  This function selects serial output data change.
23731  Precondition:
23732  None.
23733  Parameters:
23734  index - Identifier for the device instance to be configured
23735  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23736  SPI serial output data change
23737  Returns:
23738  None.
23739  Example:
23740  <code>
23741  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23742  // application developer.
23743  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23744  </code>
23745  Remarks:
23746  This function implements an operation of the output data phase feature.
23747  This feature may not be available on all devices. Please refer to the
23748  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23749  in your application to automatically determine whether this feature is available.
23750  */
23751 
23752 void
23754  SPI_MODULE_ID index ,
23755  SPI_OUTPUT_DATA_PHASE phase ) ;
23756 //******************************************************************************
23757 /* Function:
23758  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23759  SPI_CLOCK_POLARITY polarity)
23760  Summary:
23761  Enables clock polarity.
23762  Description:
23763  This function enables clock polarity.
23764  Precondition:
23765  None.
23766  Parameters:
23767  index - Identifier for the device instance to be configured
23768  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23769  Returns:
23770  None.
23771  Example:
23772  <code>
23773  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23774  // application developer.
23775  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23776  </code>
23777  Remarks:
23778  This function implements an operation of the clock polarity feature.
23779  This feature may not be available on all devices. Please refer to the
23780  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23781  in your application to automatically determine whether this feature is available.
23782  */
23783 
23784 void
23786  SPI_MODULE_ID index ,
23787  SPI_CLOCK_POLARITY polarity ) ;
23788 //******************************************************************************
23789 /* Function:
23790  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23791  Summary:
23792  Enables the SPI in Master mode.
23793  Description:
23794  This function enables the SPI in Master mode.
23795  This operation is atomic.
23796  Precondition:
23797  None.
23798  Parameters:
23799  index - Identifier for the device instance to be configured
23800  Returns:
23801  None.
23802  Example:
23803  <code>
23804  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23805  // application developer.
23806  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23807  </code>
23808  Remarks:
23809  This function implements an operation of the master enable control feature.
23810  This feature may not be available on all devices. Please refer to the
23811  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23812  in your application to automatically determine whether this feature is available.
23813  */
23814 
23815 void
23817  SPI_MODULE_ID index ) ;
23818 //******************************************************************************
23819 /* Function:
23820  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23821  Summary:
23822  Enables the SPI in Slave mode.
23823  Description:
23824  This function enables the SPI in Slave mode.
23825  This operation is atomic.
23826  Precondition:
23827  None.
23828  Parameters:
23829  index - Identifier for the device instance to be configured
23830  Returns:
23831  None.
23832  Example:
23833  <code>
23834  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23835  // application developer.
23836  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23837  </code>
23838  Remarks:
23839  This function implements an operation of the master enable control feature.
23840  This feature may not be available on all devices. Please refer to the
23841  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23842  in your application to automatically determine whether this feature is available.
23843  */
23844 
23845 void
23847  SPI_MODULE_ID index ) ;
23848 //******************************************************************************
23849 /* Function:
23850  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23851  uint32_t baudRate )
23852  Summary:
23853  Sets the baud rate to the desired value.
23854  Description:
23855  This function sets the baud rate to the desired value.
23856  Precondition:
23857  None.
23858  Parameters:
23859  index - Identifier for the device instance to be configured
23860  clockFrequency - Clock frequency
23861  baudrate - Baud rate value
23862  Returns:
23863  None.
23864  Example:
23865  <code>
23866  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23867  // application developer.
23868  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23869  </code>
23870  Remarks:
23871  Setting a new baud rate value causes the baud rate timer to reset.
23872  This ensures that the baud rate timer does not have to overflow before
23873  outputting the new baud rate.
23874  If the system clock is changed during an active receive operation, a
23875  receive error or data loss may result. To avoid this issue, verify that
23876  no receptions are in progress before changing the system clock.
23877  This function implements an operation of the baud rate set feature.
23878  This feature may not be available on all devices. Please refer to the
23879  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23880  in your application to automatically determine whether this feature is available.
23881  */
23882 
23883 void
23885  SPI_MODULE_ID index ,
23886  uint32_t clockFrequency ,
23887  uint32_t baudRate ) ;
23888 //******************************************************************************
23889 /* Function:
23890  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23891  Summary:
23892  Returns the current SPI module activity status.
23893  Description:
23894  This function returns the current SPI module activity status.
23895  This operation is atomic.
23896  Precondition:
23897  None.
23898  Parameters:
23899  index - Identifier for the device instance to be configured
23900  Returns:
23901  - true - SPI module is currently busy with some transactions
23902  - false - SPI module is currently idle
23903  Example:
23904  <code>
23905  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23906  // application developer.
23907  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23908  </code>
23909  Remarks:
23910  This function implements an operation of the bus status feature.
23911  This feature may not be available on all devices. Please refer to the
23912  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23913  in your application to automatically determine whether this feature is available.
23914  */
23915 
23916 bool
23917  PLIB_SPI_IsBusy (
23918  SPI_MODULE_ID index ) ;
23919 //******************************************************************************
23920 /* Function:
23921  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23922  Summary:
23923  Returns the current status of the receive (RX) FIFO sign-extended data.
23924  Description:
23925  This function returns the current status of the receive (RX) FIFO
23926  sign-extended data.
23927  This operation is atomic.
23928  Precondition:
23929  None.
23930  Parameters:
23931  index - Identifier for the device instance to be configured
23932  Returns:
23933  - true - Data from RX FIFO is sign-extended
23934  - false - Data from RX FIFO is not sign-extended
23935  Example:
23936  <code>
23937  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23938  // application developer.
23939  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23940  </code>
23941  Remarks:
23942  This function implements an operation of the data sign feature.
23943  This feature may not be available on all devices. Please refer to the
23944  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23945  in your application to automatically determine whether this feature is available.
23946  */
23947 
23948 bool
23950  SPI_MODULE_ID index ) ;
23951 //******************************************************************************
23952 /* Function:
23953  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23954  Summary:
23955  Enables Master mode slave select.
23956  Description:
23957  This function enables Master mode slave select.
23958  This operation is atomic.
23959  Precondition:
23960  None.
23961  Parameters:
23962  index - Identifier for the device instance to be configured
23963  Returns:
23964  None.
23965  Example:
23966  <code>
23967  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23968  // application developer.
23969  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23970  </code>
23971  Remarks:
23972  This feature does not support Framed SPI mode.
23973  This function implements an operation of the Master mode slave select feature.
23974  This feature may not be available on all devices. Please refer to the
23975  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23976  in your application to automatically determine whether this feature is available.
23977 
23978  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23979  */
23980 
23981 void
23983  SPI_MODULE_ID index ) ;
23984 //******************************************************************************
23985 /* Function:
23986  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23987  Summary:
23988  Disables Master mode slave select.
23989  Description:
23990  This function disables Master mode slave select.
23991  This operation is atomic.
23992  Precondition:
23993  None.
23994  Parameters:
23995  index - Identifier for the device instance to be configured
23996  Returns:
23997  None.
23998  Example:
23999  <code>
24000  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24001  // application developer.
24002  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
24003  </code>
24004  Remarks:
24005  This feature does not support Framed SPI mode.
24006  This function implements an operation of the slave select feature.
24007  This feature may not be available on all devices. Please refer to the
24008  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24009  in your application to automatically determine whether this feature is available.
24010 
24011  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24012  */
24013 
24014 void
24016  SPI_MODULE_ID index ) ;
24017 //******************************************************************************
24018 /* Function:
24019  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24020  Summary:
24021  Returns the current status of the transmit underrun.
24022  Description:
24023  This function returns the current status of the transmit underrun.
24024  This operation is atomic.
24025  Precondition:
24026  None.
24027  Parameters:
24028  index - Identifier for the device instance to be configured
24029  Returns:
24030  - true - Transmit buffer has encountered an underrun condition
24031  - false - Transmit buffer run has not encountered an underrun condition
24032  Example:
24033  <code>
24034  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24035  // application developer.
24036  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24037  </code>
24038  Remarks:
24039  Valid in Framed Sync mode.
24040  This function implements an operation of the transmit underrun status feature.
24041  This feature may not be available on all devices. Please refer to the
24042  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24043  in your application to automatically determine whether this feature is available.
24044  */
24045 
24046 bool
24048  SPI_MODULE_ID index ) ;
24049 //******************************************************************************
24050 /* Function:
24051  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24052  Summary:
24053  Clears the SPI transmit underrun flag.
24054  Description:
24055  This function clears the SPI transmit underrun flag.
24056  This operation is atomic.
24057  Precondition:
24058  None.
24059  Parameters:
24060  index - Identifier for the device instance to be configured
24061  Returns:
24062  None.
24063  Example:
24064  <code>
24065  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24066  // application developer.
24067  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24068  </code>
24069  Remarks:
24070  This function implements an operation of the transmit underrun status feature.
24071  This feature may not be available on all devices. Please refer to the
24072  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24073  in your application to automatically determine whether this feature is available.
24074  */
24075 
24076 void
24078  SPI_MODULE_ID index ) ;
24079 //******************************************************************************
24080 /* Function:
24081  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24082  Summary:
24083  Returns the current status of the transmit buffer.
24084  Description:
24085  This function returns the current status of the transmit buffer.
24086  This operation is atomic.
24087  Precondition:
24088  None.
24089  Parameters:
24090  index - Identifier for the device instance to be configured
24091  Returns:
24092  - true - Transmit buffer is empty
24093  - false - Transmit buffer is not empty
24094  Example:
24095  <code>
24096  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24097  // application developer.
24098  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24099  </code>
24100  Remarks:
24101  This function implements an operation of the transmit buffer empty status feature.
24102  This feature may not be available on all devices. Please refer to the
24103  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24104  in your application to automatically determine whether this feature is available.
24105  */
24106 
24107 bool
24109  SPI_MODULE_ID index ) ;
24110 //******************************************************************************
24111 /* Function:
24112  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24113  Summary:
24114  Enables the SPI enhanced buffer.
24115  Description:
24116  This function enables the SPI enhanced buffer.
24117  This operation is atomic.
24118  Precondition:
24119  None.
24120  Parameters:
24121  index - Identifier for the device instance to be configured
24122  Returns:
24123  None.
24124  Example:
24125  <code>
24126  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24127  // application developer.
24128  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24129  </code>
24130  Remarks:
24131  This enables the enhanced buffer mode.
24132  This function implements an operation of the FIFO control feature.
24133  This feature may not be available on all devices. Please refer to the
24134  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24135  in your application to automatically determine whether this feature is available.
24136  */
24137 
24138 void
24140  SPI_MODULE_ID index ) ;
24141 //******************************************************************************
24142 /* Function:
24143  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24144  Summary:
24145  Disables the SPI enhanced buffer.
24146  Description:
24147  This function disables the SPI enhanced buffer.
24148  This operation is atomic.
24149  Precondition:
24150  None.
24151  Parameters:
24152  index - Identifier for the device instance to be configured
24153  Returns:
24154  None.
24155  Example:
24156  <code>
24157  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24158  // application developer.
24159  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24160  </code>
24161  Remarks:
24162  Enables the legacy standard single buffer mode.
24163  This function implements an operation of the FIFO control feature.
24164  This feature may not be available on all devices. Please refer to the
24165  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24166  in your application to automatically determine whether this feature is available.
24167  */
24168 
24169 void
24171  SPI_MODULE_ID index ) ;
24172 //******************************************************************************
24173 /* Function:
24174  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24175  Summary:
24176  Reads the SPI Buffer Element Count bits for either receive or transmit.
24177  Description:
24178  This function reads the number of SPI transfers pending for Master mode
24179  and the number of unread SPI transfers for Slave mode.
24180  Precondition:
24181  None.
24182  Parameters:
24183  index - Identifier for the device instance to be configured
24184  type - One of the SPI_FIFO_TYPE enumeration values
24185  Returns:
24186  CountValue - Buffer element count bits
24187  Example:
24188  <code>
24189  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24190  // application developer.
24191  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24192  </code>
24193  Remarks:
24194  Valid in Enhanced Buffer mode.
24195  This function implements an operation of the FIFO control feature.
24196  This feature may not be available on all devices. Please refer to the
24197  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24198  in your application to automatically determine whether this feature is available.
24199  */
24200 
24201 uint8_t
24203  SPI_MODULE_ID index ,
24204  SPI_FIFO_TYPE type ) ;
24205 //******************************************************************************
24206 /* Function:
24207  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24208  Summary:
24209  Returns the current status of the SPI shift register.
24210  Description:
24211  This function returns the current status of the SPI shift register.
24212  This operation is atomic.
24213  Precondition:
24214  None.
24215  Parameters:
24216  index - Identifier for the device instance to be configured
24217  Returns:
24218  - true - SPI shift register is empty and ready to send or receive
24219  - false - SPI shift register is not empty
24220  Example:
24221  <code>
24222  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24223  // application developer.
24224  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24225  </code>
24226  Remarks:
24227  Valid in Enhanced Buffer mode.
24228  This function implements an operation of the FIFO status feature.
24229  This feature may not be available on all devices. Please refer to the
24230  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24231  in your application to automatically determine whether this feature is available.
24232  */
24233 
24234 bool
24236  SPI_MODULE_ID index ) ;
24237 //******************************************************************************
24238 /* Function:
24239  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24240  Summary:
24241  Returns the current status of the SPI receive FIFO.
24242  Description:
24243  This function returns the current status of the SPI receive FIFO.
24244  This operation is atomic.
24245  Precondition:
24246  None.
24247  Parameters:
24248  index - Identifier for the device instance to be configured
24249  Returns:
24250  - true - Receive FIFO is empty
24251  - false - Receive FIFO is not empty
24252  Example:
24253  <code>
24254  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24255  // application developer.
24256  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24257  </code>
24258  Remarks:
24259  Valid in Enhanced Buffer mode.
24260  This function implements an operation of the FIFO status feature.
24261  This feature may not be available on all devices. Please refer to the
24262  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24263  in your application to automatically determine whether this feature is available.
24264  */
24265 
24266 bool
24268  SPI_MODULE_ID index ) ;
24269 //******************************************************************************
24270 /* Function:
24271  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24272  SPI_FIFO_INTERRUPT mode)
24273  Summary:
24274  Selects the SPI buffer interrupt mode.
24275  Description:
24276  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24277  Precondition:
24278  None.
24279  Parameters:
24280  index - Identifier for the device instance to be configured
24281  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24282  interrupt mode
24283  Returns:
24284  None.
24285  Example:
24286  <code>
24287  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24288  // application developer.
24289  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24290  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24291  </code>
24292  Remarks:
24293  Valid in Enhanced Buffer mode.
24294  This function implements an operation of the FIFO interrupt feature.
24295  This feature may not be available on all devices. Please refer to the
24296  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24297  in your application to automatically determine whether this feature is available.
24298  */
24299 
24300 void
24302  SPI_MODULE_ID index ,
24303  SPI_FIFO_INTERRUPT mode ) ;
24304 //******************************************************************************
24305 /* Function:
24306  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24307  Summary:
24308  Enables framed SPI support.
24309  Description:
24310  This function enables framed SPI support.
24311  This operation is atomic.
24312  Precondition:
24313  None.
24314  Parameters:
24315  index - Identifier for the device instance to be configured
24316  Returns:
24317  None.
24318  Example:
24319  <code>
24320  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24321  // application developer.
24322  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24323  </code>
24324  Remarks:
24325  This function implements an operation of the framed communication feature.
24326  This feature may not be available on all devices. Please refer to the
24327  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24328  in your application to automatically determine whether this feature is available.
24329  */
24330 
24331 void
24333  SPI_MODULE_ID index ) ;
24334 //******************************************************************************
24335 /* Function:
24336  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24337  Summary:
24338  Disables framed SPI support.
24339  Description:
24340  This function disables framed SPI support.
24341  This operation is atomic.
24342  Precondition:
24343  None.
24344  Parameters:
24345  index - Identifier for the device instance to be configured
24346  Returns:
24347  None.
24348  Example:
24349  <code>
24350  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24351  // application developer.
24352  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24353  </code>
24354  Remarks:
24355  This function implements an operation of the framed communication feature.
24356  This feature may not be available on all devices. Please refer to the
24357  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24358  in your application to automatically determine whether this feature is available.
24359  */
24360 
24361 void
24363  SPI_MODULE_ID index ) ;
24364 //******************************************************************************
24365 /* Function:
24366  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24367  SPI_FRAME_PULSE_DIRECTION direction)
24368  Summary:
24369  Selects the frame sync pulse direction.
24370  Description:
24371  This function selects the frame sync pulse direction.
24372  Precondition:
24373  None.
24374  Parameters:
24375  index - Identifier for the device instance to be configured
24376  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24377  as the SPI frame sync pulse polarity
24378  Returns:
24379  None.
24380  Example:
24381  <code>
24382  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24383  // application developer.
24384  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24385  </code>
24386  Remarks:
24387  This function implements an operation of the framed communication feature.
24388  This feature may not be available on all devices. Please refer to the
24389  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24390  in your application to automatically determine whether this feature is available.
24391  */
24392 
24393 void
24395  SPI_MODULE_ID index ,
24396  SPI_FRAME_PULSE_DIRECTION direction ) ;
24397 //******************************************************************************
24398 /* Function:
24399  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24400  SPI_FRAME_PULSE_POLARITY polarity)
24401  Summary:
24402  Selects the frame sync pulse polarity.
24403  Description:
24404  This function selects the frame sync pulse polarity.
24405  Precondition:
24406  None.
24407  Parameters:
24408  index - Identifier for the device instance to be configured
24409  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24410  sync pulse polarity
24411  Returns:
24412  None.
24413  Example:
24414  <code>
24415  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24416  // application developer.
24417  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24418  </code>
24419  Remarks:
24420  Available only for Frame mode.
24421  This function implements an operation of the framed communication feature.
24422  This feature may not be available on all devices. Please refer to the
24423  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24424  in your application to automatically determine whether this feature is available.
24425  */
24426 
24427 void
24429  SPI_MODULE_ID index ,
24430  SPI_FRAME_PULSE_POLARITY polarity ) ;
24431 //******************************************************************************
24432 /* Function:
24433  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24434  SPI_FRAME_PULSE_EDGE edge)
24435  Summary:
24436  Selects the frame sync pulse edge.
24437  Description:
24438  This function selects the frame sync pulse edge.
24439  Precondition:
24440  None.
24441  Parameters:
24442  index - Identifier for the device instance to be configured
24443  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24444  SPI frame sync pulse edge
24445  Returns:
24446  None.
24447  Example:
24448  <code>
24449  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24450  // application developer.
24451  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24452  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24453  </code>
24454  Remarks:
24455  This function implements an operation of the framed communication feature.
24456  This feature may not be available on all devices. Please refer to the
24457  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24458  in your application to automatically determine whether this feature is available.
24459  */
24460 
24461 void
24463  SPI_MODULE_ID index ,
24464  SPI_FRAME_PULSE_EDGE edge ) ;
24465 //******************************************************************************
24466 /* Function:
24467  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24468  SPI_FRAME_PULSE_WIDTH width)
24469  Summary:
24470  Sets the frame sync pulse width.
24471  Description:
24472  This function sets the frame sync pulse width.
24473  Precondition:
24474  None.
24475  Parameters:
24476  index - Identifier for the device instance to be configured
24477  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24478  frame sync pulse width.
24479  Returns:
24480  None.
24481  Example:
24482  <code>
24483  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24484  // application developer.
24485  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24486  </code>
24487  Remarks:
24488  Length of the word is dependent on the communication mode.
24489  This function implements an operation of the framed communication feature.
24490  This feature may not be available on all devices. Please refer to the
24491  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24492  in your application to automatically determine whether this feature is available.
24493  */
24494 
24495 void
24497  SPI_MODULE_ID index ,
24498  SPI_FRAME_PULSE_WIDTH width ) ;
24499 //******************************************************************************
24500 /* Function:
24501  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24502  SPI_FRAME_SYNC_PULSE pulse)
24503  Summary:
24504  Selects at which character the SPI frame sync pulse is generated.
24505  Description:
24506  This function selects at which character the SPI frame sync pulse is generated.
24507  Precondition:
24508  None.
24509  Parameters:
24510  index - Identifier for the device instance to be configured
24511  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24512  frame sync pulse count
24513  Returns:
24514  None.
24515  Example:
24516  <code>
24517  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24518  // application developer.
24519  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24520  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24521  </code>
24522  Remarks:
24523  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24524  This function implements an operation of the framed communication feature.
24525  This feature may not be available on all devices. Please refer to the
24526  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24527  in your application to automatically determine whether this feature is available.
24528  */
24529 
24530 void
24532  SPI_MODULE_ID index ,
24533  SPI_FRAME_SYNC_PULSE pulse ) ;
24534 //******************************************************************************
24535 /* Function:
24536  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24537  Summary:
24538  Returns the current status of the SPI frame error.
24539  Description:
24540  This function returns the current status of the SPI frame error.
24541  This operation is atomic.
24542  Precondition:
24543  None.
24544  Parameters:
24545  index - Identifier for the device instance to be configured
24546  Returns:
24547  - true - Frame error detected
24548  - false - No frame error detected
24549  Example:
24550  <code>
24551  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24552  // application developer.
24553  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24554  </code>
24555  Remarks:
24556  Valid only if Frame mode is enabled.
24557  This function implements an operation of the framed communication feature.
24558  This feature may not be available on all devices. Please refer to the
24559  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24560  in your application to automatically determine whether this feature is available.
24561  */
24562 
24563 bool
24565  SPI_MODULE_ID index ) ;
24566 //******************************************************************************
24567 /* Function:
24568  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24569  Summary:
24570  Clears the SPI frame error flag.
24571  Description:
24572  This function clears the SPI frame error flag.
24573  This operation is atomic.
24574  Precondition:
24575  None.
24576  Parameters:
24577  index - Identifier for the device instance to be configured
24578  Returns:
24579  None.
24580  Example:
24581  <code>
24582  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24583  // application developer.
24584  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24585  </code>
24586  Remarks:
24587  This function implements an operation of the frame error status feature.
24588  This feature may not be available on all devices. Please refer to the
24589  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24590  in your application to automatically determine whether this feature is available.
24591  */
24592 
24593 void
24595  SPI_MODULE_ID index ) ;
24596 //******************************************************************************
24597 /* Function:
24598  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24599  Summary:
24600  Clears the SPI receive buffer.
24601  Description:
24602  This function clears the SPI receive buffer.
24603  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24604  This operation is atomic.
24605  Precondition:
24606  None.
24607  Parameters:
24608  index - Identifier for the device instance to be configured
24609  Returns:
24610  None.
24611  Example:
24612  <code>
24613  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24614  // application developer.
24615  //This call will flush the receive buffer.
24616  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24617  </code>
24618  Remarks:
24619  This function implements an operation of the buffer control feature.
24620  This feature may not be available on all devices. Please refer to the
24621  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24622  in your application to automatically determine whether this feature is available.
24623  */
24624 
24625 void
24627  SPI_MODULE_ID index ) ;
24628 //******************************************************************************
24629 /* Function:
24630  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24631  Summary:
24632  Returns the SPI buffer value.
24633  Description:
24634  This function returns the SPI buffer value.
24635  This operation is atomic.
24636  Precondition:
24637  None.
24638  Parameters:
24639  index - Identifier for the device instance to be configured
24640  Returns:
24641  Reads the SPI buffer.
24642  Example:
24643  <code>
24644  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24645  // application developer.
24646  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24647  </code>
24648  Remarks:
24649  This function implements an operation of the buffer control feature.
24650  This feature may not be available on all devices. Please refer to the
24651  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24652  in your application to automatically determine whether this feature is available.
24653  */
24654 
24655 uint8_t
24657  SPI_MODULE_ID index ) ;
24658 //******************************************************************************
24659 /* Function:
24660  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24661  Summary:
24662  Returns 16-bit SPI buffer value.
24663  Description:
24664  This function returns 16-bit SPI buffer value.
24665  This operation is atomic.
24666  Precondition:
24667  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24668  Parameters:
24669  index - Identifier for the device instance to be configured
24670  Returns:
24671  Returns the SPI 16-bit buffer value.
24672  Example:
24673  <code>
24674 #define MY_SPI_INSTANCE SPI_ID_1
24675 
24676  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24677  </code>
24678  Remarks:
24679  This function implements an operation of the buffer control feature.
24680  This feature may not be available on all devices. Please refer to the
24681  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24682  in your application to automatically determine whether this feature is available.
24683  */
24684 
24685 uint16_t
24687  SPI_MODULE_ID index ) ;
24688 //******************************************************************************
24689 /* Function:
24690  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24691  Summary:
24692  Returns 32-bit SPI buffer value.
24693  Description:
24694  This function returns 32-bit SPI buffer value.
24695  This operation is atomic.
24696  Precondition:
24697  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24698  Parameters:
24699  index - Identifier for the device instance to be configured
24700  Returns:
24701  Returns the SPI 32-bit buffer value.
24702  Example:
24703  <code>
24704 #define MY_SPI_INSTANCE SPI_ID_1
24705 
24706  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24707  </code>
24708  Remarks:
24709  This function implements an operation of the buffer control feature.
24710  This feature may not be available on all devices. Please refer to the
24711  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24712  in your application to automatically determine whether this feature is available.
24713  */
24714 
24715 uint32_t
24717  SPI_MODULE_ID index ) ;
24718 //******************************************************************************
24719 /* Function:
24720  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24721  Summary:
24722  Write the data to the SPI buffer.
24723  Description:
24724  This function writes data to the SPI buffer.
24725  This operation is atomic.
24726  Precondition:
24727  None.
24728  Parameters:
24729  index - Identifier for the device instance to be configured
24730  data - Data to written to the SPI buffer
24731  Returns:
24732  None.
24733  Example:
24734  <code>
24735  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24736  // application developer.
24737  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24738  </code>
24739  Remarks:
24740  This function implements an operation of the buffer control feature.
24741  This feature may not be available on all devices. Please refer to the
24742  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24743  in your application to automatically determine whether this feature is available.
24744  */
24745 
24746 void
24748  SPI_MODULE_ID index ,
24749  uint8_t data ) ;
24750 //******************************************************************************
24751 /* Function:
24752  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24753  Summary:
24754  Writes 16-bit data to the SPI buffer.
24755  Description:
24756  This function writes 16-bit data to the SPI buffer.
24757  This operation is atomic.
24758  Precondition:
24759  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24760  Parameters:
24761  index - Identifier for the device instance to be configured
24762  data - 16-bit data to be written to the SPI buffer
24763  Returns:
24764  None.
24765  Example:
24766  <code>
24767 #define MY_SPI_INSTANCE SPI_ID_1
24768 
24769  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24770  </code>
24771  Remarks:
24772  This function implements an operation of the buffer control feature.
24773  This feature may not be available on all devices. Please refer to the
24774  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24775  in your application to automatically determine whether this feature is available.
24776  */
24777 
24778 void
24780  SPI_MODULE_ID index ,
24781  uint16_t data ) ;
24782 //******************************************************************************
24783 /* Function:
24784  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24785  Summary:
24786  Write 32-bit data to the SPI buffer.
24787  Description:
24788  This function writes 32-bit data to the SPI buffer.
24789  This operation is atomic.
24790  Precondition:
24791  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24792  Parameters:
24793  index - Identifier for the device instance to be configured
24794  data - 32-bit data to be written to the SPI buffer
24795  Returns:
24796  None.
24797  Example:
24798  <code>
24799 #define MY_SPI_INSTANCE SPI_ID_1
24800 
24801  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24802  </code>
24803  Remarks:
24804  This function implements an operation of the buffer control feature.
24805  This feature may not be available on all devices. Please refer to the
24806  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24807  in your application to automatically determine whether this feature is available.
24808  */
24809 
24810 void
24812  SPI_MODULE_ID index ,
24813  uint32_t data ) ;
24814 //******************************************************************************
24815 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24816  Summary:
24817  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24818  register.
24819  Description:
24820  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24821  (SPIxRXB)) register.
24822  This operation is atomic.
24823  Preconditions:
24824  None.
24825  Parameters:
24826  index - Identifier for the device instance
24827  Returns:
24828  The address of the SPIxBUF register
24829  Remarks:
24830  None.
24831 */
24832 
24833 void *
24835  SPI_MODULE_ID index ) ;
24836 //******************************************************************************
24837 /* Function:
24838  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24839  SPI_BAUD_RATE_CLOCK type)
24840  Summary:
24841  Selects the type of clock is used by the Baud Rate Generator.
24842  Description:
24843  This function selects the type of clock is used by the Baud Rate Generator.
24844  Precondition:
24845  None.
24846  Parameters:
24847  index - Identifier for the device instance to be configured
24848  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24849  Returns:
24850  None.
24851  Example:
24852  <code>
24853  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24854  // application developer.
24855  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24856  </code>
24857  Remarks:
24858  This function implements an operation of the baud rate clock control feature.
24859  This feature may not be available on all devices. Please refer to the
24860  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24861  in your application to automatically determine whether this feature is available.
24862  */
24863 
24864 void
24866  SPI_MODULE_ID index ,
24867  SPI_BAUD_RATE_CLOCK type ) ;
24868 //******************************************************************************
24869 /* Function:
24870  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24871  SPI_ERROR_INTERRUPT error)
24872  Summary:
24873  Enables SPI error interrupts
24874  Description:
24875  This function enables SPI error interrupts.
24876  Precondition:
24877  None.
24878  Parameters:
24879  index - Identifier for the device instance to be configured
24880  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24881  SPI interrupt error
24882  Returns:
24883  None.
24884  Example:
24885  <code>
24886  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24887  // application developer.
24888  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24889  </code>
24890  Remarks:
24891  This function implements an operation of the error interrupt control feature.
24892  This feature may not be available on all devices. Please refer to the
24893  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24894  in your application to automatically determine whether this feature is available.
24895  */
24896 
24897 void
24899  SPI_MODULE_ID index ,
24900  SPI_ERROR_INTERRUPT error ) ;
24901 //******************************************************************************
24902 /* Function:
24903  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24904  SPI_ERROR_INTERRUPT error)
24905  Summary:
24906  Enables SPI error interrupts.
24907  Description:
24908  This function enables SPI error interrupts.
24909  Precondition:
24910  None.
24911  Parameters:
24912  index - Identifier for the device instance to be configured
24913  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24914  SPI interrupt error
24915  Returns:
24916  None.
24917  Example:
24918  <code>
24919  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24920  // application developer.
24921  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24922  </code>
24923  Remarks:
24924  This function implements an operation of the error interrupt control feature.
24925  This feature may not be available on all devices. Please refer to the
24926  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24927  in your application to automatically determine whether this feature is available.
24928  */
24929 
24930 void
24932  SPI_MODULE_ID index ,
24933  SPI_ERROR_INTERRUPT error ) ;
24934 //******************************************************************************
24935 /* Function:
24936  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24937  Summary:
24938  Enables the SPI error.
24939  Description:
24940  This function enables the SPI error.
24941  This operation is atomic.
24942  Precondition:
24943  None.
24944  Parameters:
24945  index - Identifier for the device instance to be configured
24946  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24947  Returns:
24948  None.
24949  Example:
24950  <code>
24951  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24952  // application developer.
24953  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24954  </code>
24955  Remarks:
24956  This function implements an operation of the audio error control feature.
24957  This feature may not be available on all devices. Please refer to the
24958  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24959  in your application to automatically determine whether this feature is available.
24960  */
24961 
24962 void
24964  SPI_MODULE_ID index ,
24965  SPI_AUDIO_ERROR error ) ;
24966 //******************************************************************************
24967 /* Function:
24968  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24969  Summary:
24970  Disables the SPI error.
24971  Description:
24972  This function disables the SPI error.
24973  This operation is atomic.
24974  Precondition:
24975  None.
24976  Parameters:
24977  index - Identifier for the device instance to be configured
24978  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24979  Returns:
24980  None.
24981  Example:
24982  <code>
24983  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24984  // application developer.
24985  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24986  </code>
24987  Remarks:
24988  This function implements an operation of the audio error control feature.
24989  This feature may not be available on all devices. Please refer to the
24990  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24991  in your application to automatically determine whether this feature is available.
24992  */
24993 
24994 void
24996  SPI_MODULE_ID index ,
24997  SPI_AUDIO_ERROR error ) ;
24998 //******************************************************************************
24999 /* Function:
25000  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
25001  Summary:
25002  Audio protocol is enabled.
25003  Description:
25004  This function enables the audio protocol.
25005  This operation is atomic.
25006  Precondition:
25007  Disable the SPI module by calling PLIB_SPI_Disable.
25008  Parameters:
25009  index - Identifier for the device instance to be configured
25010  Returns:
25011  None.
25012  Example:
25013  <code>
25014  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25015  // application developer.
25016  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25017  </code>
25018  Remarks:
25019  This function implements an operation of the audio protocol control feature.
25020  This feature may not be available on all devices. Please refer to the
25021  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25022  in your application to automatically determine whether this feature is available.
25023  */
25024 
25025 void
25027  SPI_MODULE_ID index ) ;
25028 //******************************************************************************
25029 /* Function:
25030  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25031  Summary:
25032  Audio protocol is disabled.
25033  Description:
25034  This function disables the audio protocol.
25035  This operation is atomic.
25036  Precondition:
25037  None.
25038  Parameters:
25039  index - Identifier for the device instance to be configured
25040  Returns:
25041  None.
25042  Example:
25043  <code>
25044  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25045  // application developer.
25046  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25047  </code>
25048  Remarks:
25049  This function implements an operation of the audio protocol control feature.
25050  This feature may not be available on all devices. Please refer to the
25051  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25052  in your application to automatically determine whether this feature is available.
25053  */
25054 
25055 void
25057  SPI_MODULE_ID index ) ;
25058 //******************************************************************************
25059 /* Function:
25060  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25061  SPI_AUDIO_TRANSMIT_MODE mode)
25062  Summary:
25063  Selects the transmit audio data format.
25064  Description:
25065  This function selects the transmit audio data format.
25066  Precondition:
25067  None.
25068  Parameters:
25069  index - Identifier for the device instance to be configured
25070  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25071  transmit audio format
25072  Returns:
25073  None.
25074  Example:
25075  <code>
25076  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25077  // application developer.
25078  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25079  </code>
25080  Remarks:
25081  This function implements an operation of the audio transmit mode feature.
25082  This feature may not be available on all devices. Please refer to the
25083  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25084  in your application to automatically determine whether this feature is available.
25085  */
25086 
25087 void
25089  SPI_MODULE_ID index ,
25090  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25091 //******************************************************************************
25092 /* Function:
25093  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25094  SPI_AUDIO_PROTOCOL mode )
25095  Summary:
25096  Selects the Audio Protocol mode.
25097  Description:
25098  This function selects the Audio Protocol mode.
25099  Precondition:
25100  None.
25101  Parameters:
25102  index - Identifier for the device instance to be configured
25103  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25104  audio protocol
25105  Returns:
25106  None.
25107  Example:
25108  <code>
25109  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25110  // application developer.
25111  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25112  </code>
25113  Remarks:
25114  This function implements an operation of the audio protocol mode feature.
25115  This feature may not be available on all devices. Please refer to the
25116  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25117  in your application to automatically determine whether this feature is available.
25118  */
25119 
25120 void
25122  SPI_MODULE_ID index ,
25123  SPI_AUDIO_PROTOCOL mode ) ;
25124 // *****************************************************************************
25125 // *****************************************************************************
25126 // Section: SPI Peripheral Library Exists Functions
25127 // *****************************************************************************
25128 // *****************************************************************************
25129 /* The following functions indicate the existence of the features on the device.
25130 */
25131 //******************************************************************************
25132 /* Function:
25133  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25134  Summary:
25135  Identifies whether the EnableControl feature exists on the SPI module.
25136  Description:
25137  This function identifies whether the EnableControl feature is available on
25138  the SPI module.
25139  When this function returns true, these functions are supported on the device:
25140  - PLIB_SPI_Enable
25141  - PLIB_SPI_Disable
25142  This operation is atomic.
25143  Preconditions:
25144  None.
25145  Parameters:
25146  index - Identifier for the device instance
25147  Returns:
25148  - true - The EnableControl feature is supported on the device
25149  - false - The EnableControl feature is not supported on the device
25150  Remarks:
25151  None.
25152 */
25153 
25154 bool
25156  SPI_MODULE_ID index ) ;
25157 //******************************************************************************
25158 /* Function:
25159  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25160  Summary:
25161  Identifies whether the StopInIdle feature exists on the SPI module.
25162  Description:
25163  This function identifies whether the StopInIdle feature is available on the
25164  SPI module.
25165  When this function returns true, these functions are supported on the device:
25166  - PLIB_SPI_StopInIdleEnable
25167  - PLIB_SPI_StopInIdleDisable
25168  This operation is atomic.
25169  Preconditions:
25170  None.
25171  Parameters:
25172  index - Identifier for the device instance
25173  Returns:
25174  - true - The StopInIdle feature is supported on the device
25175  - false - The StopInIdle feature is not supported on the device
25176  Remarks:
25177  None.
25178 */
25179 
25180 bool
25182  SPI_MODULE_ID index ) ;
25183 //******************************************************************************
25184 /* Function:
25185  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25186  Summary:
25187  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25188  Description:
25189  This function identifies whether the ReceiverOverflow feature is available
25190  on the SPI module.
25191  When this function returns true, these functions are supported on the device:
25192  - PLIB_SPI_ReceiverHasOverflowed
25193  - PLIB_SPI_ReceiverOverflowClear
25194  This operation is atomic.
25195  Preconditions:
25196  None.
25197  Parameters:
25198  index - Identifier for the device instance
25199  Returns:
25200  - true - The ReceiverOverflow feature is supported on the device
25201  - false - The ReceiverOverflow feature is not supported on the device
25202  Remarks:
25203  None.
25204 */
25205 
25206 bool
25208  SPI_MODULE_ID index ) ;
25209 //******************************************************************************
25210 /* Function:
25211  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25212  Summary:
25213  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25214  Description:
25215  This function identifies whether the TransmitBufferFullStatus feature is available
25216  on the SPI module.
25217  When this function returns true, this function is supported on the device:
25218  - PLIB_SPI_TransmitBufferIsFull
25219  This operation is atomic.
25220  Preconditions:
25221  None.
25222  Parameters:
25223  index - Identifier for the device instance
25224  Returns:
25225  - true - The TransmitBufferFullStatus feature is supported on the device
25226  - false - The TransmitBufferFullStatus feature is not supported on the device
25227  Remarks:
25228  None.
25229 */
25230 
25231 bool
25233  SPI_MODULE_ID index ) ;
25234 //******************************************************************************
25235 /* Function:
25236  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25237  Summary:
25238  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25239  Description:
25240  This function identifies whether the TransmitBufferEmptyStatus feature is available
25241  on the SPI module.
25242  When this function returns true, this function is supported on the device:
25243  - PLIB_SPI_TransmitBufferIsEmpty
25244  This operation is atomic.
25245  Preconditions:
25246  None.
25247  Parameters:
25248  index - Identifier for the device instance
25249  Returns:
25250  - true - The TransmitBufferEmptyStatus feature is supported on the device
25251  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25252  Remarks:
25253  None.
25254 */
25255 
25256 bool
25258  SPI_MODULE_ID index ) ;
25259 //******************************************************************************
25260 /* Function:
25261  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25262  Summary:
25263  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25264  Description:
25265  This function identifies whether the ReceiveBufferStatus feature is available
25266  on the SPI module.
25267  When this function returns true, this function is supported on the device:
25268  - PLIB_SPI_ReceiverBufferIsFull
25269  This operation is atomic.
25270  Preconditions:
25271  None.
25272  Parameters:
25273  index - Identifier for the device instance
25274  Returns:
25275  - true - The ReceiveBufferStatus feature is supported on the device
25276  - false - The ReceiveBufferStatus feature is not supported on the device
25277  Remarks:
25278  None.
25279 */
25280 
25281 bool
25283  SPI_MODULE_ID index ) ;
25284 //******************************************************************************
25285 /* Function:
25286  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25287  Summary:
25288  Identifies whether the PinControl feature exists on the SPI module.
25289  Description:
25290  This function identifies whether the PinControl feature is available on the
25291  SPI module.
25292  When this function returns true, these functions are supported on the device:
25293  - PLIB_SPI_PinEnable
25294  - PLIB_SPI_PinDisable
25295  This operation is atomic.
25296  Preconditions:
25297  None.
25298  Parameters:
25299  index - Identifier for the device instance
25300  Returns:
25301  - true - The PinControl feature is supported on the device
25302  - false - The PinControl feature is not supported on the device
25303  Remarks:
25304  None.
25305 */
25306 
25307 bool
25309  SPI_MODULE_ID index ) ;
25310 //******************************************************************************
25311 /* Function:
25312  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25313  Summary:
25314  Identifies whether the CommunicationWidth feature exists on the SPI module.
25315  Description:
25316  This function identifies whether the CommunicationWidth feature is available
25317  on the SPI module.
25318  When this function returns true, this function is supported on the device:
25319  - PLIB_SPI_CommunicationWidthSelect
25320  This operation is atomic.
25321  Preconditions:
25322  None.
25323  Parameters:
25324  index - Identifier for the device instance
25325  Returns:
25326  - true - The CommunicationWidth feature is supported on the device
25327  - false - The CommunicationWidth feature is not supported on the device
25328  Remarks:
25329  None.
25330 */
25331 
25332 bool
25334  SPI_MODULE_ID index ) ;
25335 //******************************************************************************
25336 /* Function:
25337  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25338  Summary:
25339  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25340  Description:
25341  This function identifies whether the AudioCommunicationWidth feature is available
25342  on the SPI module.
25343  When this function returns true, this function is supported on the device:
25344  - PLIB_SPI_AudioCommunicationWidthSelect
25345  This operation is atomic.
25346  Preconditions:
25347  None.
25348  Parameters:
25349  index - Identifier for the device instance
25350  Returns:
25351  - true - The AudioCommunicationWidth feature is supported on the device
25352  - false - The AudioCommunicationWidth feature is not supported on the device
25353  Remarks:
25354  None.
25355 */
25356 
25357 bool
25359  SPI_MODULE_ID index ) ;
25360 //******************************************************************************
25361 /* Function:
25362  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25363  Summary:
25364  Identifies whether the InputSamplePhase feature exists on the SPI module.
25365  Description:
25366  This function identifies whether the InputSamplePhase feature is available
25367  on the SPI module.
25368  When this function returns true, this function is supported on the device:
25369  - PLIB_SPI_InputSamplePhaseSelect
25370  This operation is atomic.
25371  Preconditions:
25372  None.
25373  Parameters:
25374  index - Identifier for the device instance
25375  Returns:
25376  - true - The InputSamplePhase feature is supported on the device
25377  - false - The InputSamplePhase feature is not supported on the device
25378  Remarks:
25379  None.
25380 */
25381 
25382 bool
25384  SPI_MODULE_ID index ) ;
25385 //******************************************************************************
25386 /* Function:
25387  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25388  Summary:
25389  Identifies whether the OutputDataPhase feature exists on the SPI module.
25390  Description:
25391  This function identifies whether the OutputDataPhase feature is available on
25392  the SPI module.
25393  When this function returns true, this function is supported on the device:
25394  - PLIB_SPI_OutputDataPhaseSelect
25395  This operation is atomic.
25396  Preconditions:
25397  None.
25398  Parameters:
25399  index - Identifier for the device instance
25400  Returns:
25401  - true - The OutputDataPhase feature is supported on the device
25402  - false - The OutputDataPhase feature is not supported on the device
25403  Remarks:
25404  None.
25405 */
25406 
25407 bool
25409  SPI_MODULE_ID index ) ;
25410 //******************************************************************************
25411 /* Function:
25412  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25413  Summary:
25414  Identifies whether the ClockPolarity feature exists on the SPI module.
25415  Description:
25416  This function identifies whether the ClockPolarity feature is available on
25417  the SPI module.
25418  When this function returns true, this function is supported on the device:
25419  - PLIB_SPI_ClockPolaritySelect
25420  This operation is atomic.
25421  Preconditions:
25422  None.
25423  Parameters:
25424  index - Identifier for the device instance
25425  Returns:
25426  - true - The ClockPolarity feature is supported on the device
25427  - false - The ClockPolarity feature is not supported on the device
25428  Remarks:
25429  None.
25430 */
25431 
25432 bool
25434  SPI_MODULE_ID index ) ;
25435 //******************************************************************************
25436 /* Function:
25437  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25438  Summary:
25439  Identifies whether the MasterControl feature exists on the SPI module.
25440  Description:
25441  This function identifies whether the MasterControl feature is available on
25442  the SPI module.
25443  When this function returns true, these functions are supported on the device:
25444  - PLIB_SPI_MasterEnable
25445  - PLIB_SPI_SlaveEnable
25446  This operation is atomic.
25447  Preconditions:
25448  None.
25449  Parameters:
25450  index - Identifier for the device instance
25451  Returns:
25452  - true - The MasterControl feature is supported on the device
25453  - false - The MasterControl feature is not supported on the device
25454  Remarks:
25455  None.
25456 */
25457 
25458 bool
25460  SPI_MODULE_ID index ) ;
25461 //******************************************************************************
25462 /* Function:
25463  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25464  Summary:
25465  Identifies whether the BaudRate feature exists on the SPI module.
25466  Description:
25467  This function identifies whether the BaudRate feature is available on the SPI
25468  module.
25469  When this function returns true, this function is supported on the device:
25470  - PLIB_SPI_BaudRateSet
25471  This operation is atomic.
25472  Preconditions:
25473  None.
25474  Parameters:
25475  index - Identifier for the device instance
25476  Returns:
25477  - true - The BaudRate feature is supported on the device
25478  - false - The BaudRate feature is not supported on the device
25479  Remarks:
25480  None.
25481 */
25482 
25483 bool
25485  SPI_MODULE_ID index ) ;
25486 //******************************************************************************
25487 /* Function:
25488  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25489  Summary:
25490  Identifies whether the BusStatus feature exists on the SPI module.
25491  Description:
25492  This function identifies whether the BusStatus feature is available on the
25493  SPI module.
25494  When this function returns true, this function is supported on the device:
25495  - PLIB_SPI_IsBusy
25496  This operation is atomic.
25497  Preconditions:
25498  None.
25499  Parameters:
25500  index - Identifier for the device instance
25501  Returns:
25502  - true - The BusStatus feature is supported on the device
25503  - false - The BusStatus feature is not supported on the device
25504  Remarks:
25505  None.
25506 */
25507 
25508 bool
25510  SPI_MODULE_ID index ) ;
25511 //******************************************************************************
25512 /* Function:
25513  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25514  Summary:
25515  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25516  Description:
25517  This function identifies whether the ReadDataSignStatus feature is available
25518  on the SPI module.
25519  When this function returns true, this function is supported on the device:
25520  - PLIB_SPI_ReadDataIsSignExtended
25521  This operation is atomic.
25522  Preconditions:
25523  None.
25524  Parameters:
25525  index - Identifier for the device instance
25526  Returns:
25527  - true - The ReadDataSignStatus feature is supported on the device
25528  - false - The ReadDataSignStatus feature is not supported on the device
25529  Remarks:
25530  None.
25531 */
25532 
25533 bool
25535  SPI_MODULE_ID index ) ;
25536 //******************************************************************************
25537 /* Function:
25538  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25539  Summary:
25540  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25541  Description:
25542  This function identifies whether the SlaveSelectControl feature is available
25543  on the SPI module.
25544  When this function returns true, these functions are supported on the device:
25545  - PLIB_SPI_SlaveSelectEnable
25546  - PLIB_SPI_SlaveSelectDisable
25547  This operation is atomic.
25548  Preconditions:
25549  None.
25550  Parameters:
25551  index - Identifier for the device instance
25552  Returns:
25553  - true - The SlaveSelectControl feature is supported on the device
25554  - false - The SlaveSelectControl feature is not supported on the device
25555  Remarks:
25556  None.
25557 */
25558 
25559 bool
25561  SPI_MODULE_ID index ) ;
25562 //******************************************************************************
25563 /* Function:
25564  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25565  Summary:
25566  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25567  Description:
25568  This function identifies whether the TransmitUnderRunStatus feature is available
25569  on the SPI module.
25570  When this function returns true, these functions are supported on the device:
25571  - PLIB_SPI_TransmitUnderRunStatusGet
25572  - PLIB_SPI_TransmitUnderRunStatusClear
25573  This operation is atomic.
25574  Preconditions:
25575  None.
25576  Parameters:
25577  index - Identifier for the device instance
25578  Returns:
25579  - true - The TransmitUnderRunStatus feature is supported on the device
25580  - false - The TransmitUnderRunStatus feature is not supported on the device
25581  Remarks:
25582  None.
25583 */
25584 
25585 bool
25587  SPI_MODULE_ID index ) ;
25588 //******************************************************************************
25589 /* Function:
25590  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25591  Summary:
25592  Identifies whether the FIFOControl feature exists on the SPI module.
25593  Description:
25594  This function identifies whether the FIFOControl feature is available on the
25595  SPI module.
25596  When this function returns true, these functions are supported on the device:
25597  - PLIB_SPI_FIFOEnable
25598  - PLIB_SPI_FIFODisable
25599  This operation is atomic.
25600  Preconditions:
25601  None.
25602  Parameters:
25603  index - Identifier for the device instance
25604  Returns:
25605  - true - The FIFOControl feature is supported on the device
25606  - false - The FIFOControl feature is not supported on the device
25607  Remarks:
25608  None.
25609 */
25610 
25611 bool
25613  SPI_MODULE_ID index ) ;
25614 //******************************************************************************
25615 /* Function:
25616  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25617  Summary:
25618  Identifies whether the FIFOCount feature exists on the SPI module.
25619  Description:
25620  This function identifies whether the FIFOCount feature is available on the SPI module.
25621  When this function returns true, this function is supported on the device:
25622  - PLIB_SPI_FIFOCountGet
25623  This operation is atomic.
25624  Preconditions:
25625  None.
25626  Parameters:
25627  index - Identifier for the device instance
25628  Returns:
25629  - true - The FIFOCount feature is supported on the device
25630  - false - The FIFOCount feature is not supported on the device
25631  Remarks:
25632  None.
25633 */
25634 
25635 bool
25637  SPI_MODULE_ID index ) ;
25638 //******************************************************************************
25639 /* Function:
25640  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25641  Summary:
25642  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25643  Description:
25644  This function identifies whether the ReceiveFIFOStatus feature is available
25645  on the SPI module.
25646  When this function returns true, this function is supported on the device:
25647  - PLIB_SPI_ReceiverFIFOIsEmpty
25648  This operation is atomic.
25649  Preconditions:
25650  None.
25651  Parameters:
25652  index - Identifier for the device instance
25653  Returns:
25654  - true - The ReceiveFIFOStatus feature is supported on the device
25655  - false - The ReceiveFIFOStatus feature is not supported on the device
25656  Remarks:
25657  None.
25658 */
25659 
25660 bool
25662  SPI_MODULE_ID index ) ;
25663 //******************************************************************************
25664 /* Function:
25665  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25666  Summary:
25667  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25668  Description:
25669  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25670  available on the SPI module.
25671  When this function returns true, this function is supported on the device:
25672  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25673  This operation is atomic.
25674  Preconditions:
25675  None.
25676  Parameters:
25677  index - Identifier for the device instance
25678  Returns:
25679  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25680  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25681  Remarks:
25682  None.
25683 */
25684 
25685 bool
25687  SPI_MODULE_ID index ) ;
25688 //******************************************************************************
25689 /* Function:
25690  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25691  Summary:
25692  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25693  Description:
25694  This function identifies whether the FIFOInterruptMode feature is available
25695  on the SPI module.
25696  When this function returns true, this function is supported on the device:
25697  - PLIB_SPI_FIFOInterruptModeSelect
25698  This operation is atomic.
25699  Preconditions:
25700  None.
25701  Parameters:
25702  index - Identifier for the device instance
25703  Returns:
25704  - true - The FIFOInterruptMode feature is supported on the device
25705  - false - The FIFOInterruptMode feature is not supported on the device
25706  Remarks:
25707  None.
25708 */
25709 
25710 bool
25712  SPI_MODULE_ID index ) ;
25713 //******************************************************************************
25714 /* Function:
25715  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25716  Summary:
25717  Identifies whether the FramedCommunication feature exists on the SPI module.
25718  Description:
25719  This function identifies whether the FramedCommunication feature is available
25720  on the SPI module.
25721  When this function returns true, these functions are supported on the device:
25722  - PLIB_SPI_FramedCommunicationEnable
25723  - PLIB_SPI_FramedCommunicationDisable
25724  This operation is atomic.
25725  Preconditions:
25726  None.
25727  Parameters:
25728  index - Identifier for the device instance
25729  Returns:
25730  - true - The FramedCommunication feature is supported on the device
25731  - false - The FramedCommunication feature is not supported on the device
25732  Remarks:
25733  None.
25734 */
25735 
25736 bool
25738  SPI_MODULE_ID index ) ;
25739 //******************************************************************************
25740 /* Function:
25741  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25742  Summary:
25743  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25744  Description:
25745  This function identifies whether the FrameSyncPulseDirection feature is available
25746  on the SPI module.
25747  When this function returns true, this function is supported on the device:
25748  - PLIB_SPI_FrameSyncPulseDirectionSelect
25749  This operation is atomic.
25750  Preconditions:
25751  None.
25752  Parameters:
25753  index - Identifier for the device instance
25754  Returns:
25755  - true - The FrameSyncPulseDirection feature is supported on the device
25756  - false - The FrameSyncPulseDirection feature is not supported on the device
25757  Remarks:
25758  None.
25759 */
25760 
25761 bool
25763  SPI_MODULE_ID index ) ;
25764 //******************************************************************************
25765 /* Function:
25766  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25767  Summary:
25768  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25769  Description:
25770  This function identifies whether the FrameSyncPulsePolarity feature is available
25771  on the SPI module.
25772  When this function returns true, this function is supported on the device:
25773  - PLIB_SPI_FrameSyncPulsePolaritySelect
25774  This operation is atomic.
25775  Preconditions:
25776  None.
25777  Parameters:
25778  index - Identifier for the device instance
25779  Returns:
25780  - true - The FrameSyncPulsePolarity feature is supported on the device
25781  - false - The FrameSyncPulsePolarity feature is not supported on the device
25782  Remarks:
25783  None.
25784 */
25785 
25786 bool
25788  SPI_MODULE_ID index ) ;
25789 //******************************************************************************
25790 /* Function:
25791  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25792  Summary:
25793  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25794  Description:
25795  This function identifies whether the FrameSyncPulseEdge feature is available
25796  on the SPI module.
25797  When this function returns true, this function is supported on the device:
25798  - PLIB_SPI_FrameSyncPulseEdgeSelect
25799  This operation is atomic.
25800  Preconditions:
25801  None.
25802  Parameters:
25803  index - Identifier for the device instance
25804  Returns:
25805  - true - The FrameSyncPulseEdge feature is supported on the device
25806  - false - The FrameSyncPulseEdge feature is not supported on the device
25807  Remarks:
25808  None.
25809 */
25810 
25811 bool
25813  SPI_MODULE_ID index ) ;
25814 //******************************************************************************
25815 /* Function:
25816  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25817  Summary:
25818  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25819  Description:
25820  This function identifies whether the FrameSyncPulseWidth feature is available
25821  on the SPI module.
25822  When this function returns true, this function is supported on the device:
25823  - PLIB_SPI_FrameSyncPulseWidthSelect
25824  This operation is atomic.
25825  Preconditions:
25826  None.
25827  Parameters:
25828  index - Identifier for the device instance
25829  Returns:
25830  - true - The FrameSyncPulseWidth feature is supported on the device
25831  - false - The FrameSyncPulseWidth feature is not supported on the device
25832  Remarks:
25833  None.
25834 */
25835 
25836 bool
25838  SPI_MODULE_ID index ) ;
25839 //******************************************************************************
25840 /* Function:
25841  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25842  Summary:
25843  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25844  Description:
25845  This function identifies whether the FrameSyncPulseCounter feature is available
25846  on the SPI module.
25847  When this function returns true, this function is supported on the device:
25848  - PLIB_SPI_FrameSyncPulseCounterSelect
25849  This operation is atomic.
25850  Preconditions:
25851  None.
25852  Parameters:
25853  index - Identifier for the device instance
25854  Returns:
25855  - true - The FrameSyncPulseCounter feature is supported on the device
25856  - false - The FrameSyncPulseCounter feature is not supported on the device
25857  Remarks:
25858  None.
25859 */
25860 
25861 bool
25863  SPI_MODULE_ID index ) ;
25864 //******************************************************************************
25865 /* Function:
25866  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25867  Summary:
25868  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25869  Description:
25870  This function identifies whether the FrameErrorStatus feature is available on
25871  the SPI module.
25872  When this function returns true, these functions are supported on the device:
25873  - PLIB_SPI_FrameErrorStatusGet
25874  - PLIB_SPI_FrameErrorStatusClear
25875  This operation is atomic.
25876  Preconditions:
25877  None.
25878  Parameters:
25879  index - Identifier for the device instance
25880  Returns:
25881  - true - The FrameErrorStatus feature is supported on the device
25882  - false - The FrameErrorStatus feature is not supported on the device
25883  Remarks:
25884  None.
25885 */
25886 
25887 bool
25889  SPI_MODULE_ID index ) ;
25890 //******************************************************************************
25891 /* Function:
25892  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25893  Summary:
25894  Identifies whether the Buffer feature exists on the SPI module.
25895  Description:
25896  This function identifies whether the Buffer feature is available on the SPI module.
25897  When this function returns true, these functions are supported on the device:
25898  - PLIB_SPI_BufferClear
25899  - PLIB_SPI_BufferRead
25900  - PLIB_SPI_BufferWrite
25901  - PLIB_SPI_BufferAddressGet
25902  This operation is atomic.
25903  Preconditions:
25904  None.
25905  Parameters:
25906  index - Identifier for the device instance
25907  Returns:
25908  - true - The Buffer feature is supported on the device
25909  - false - The Buffer feature is not supported on the device
25910  Remarks:
25911  None.
25912 */
25913 
25914 bool
25916  SPI_MODULE_ID index ) ;
25917 //******************************************************************************
25918 /* Function:
25919  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25920  Summary:
25921  Identifies whether the BaudRateClock feature exists on the SPI module.
25922  Description:
25923  This function identifies whether the BaudRateClock feature is available on
25924  the SPI module.
25925  When this function returns true, this function is supported on the device:
25926  - PLIB_SPI_BaudRateClockSelect
25927  This operation is atomic.
25928  Preconditions:
25929  None.
25930  Parameters:
25931  index - Identifier for the device instance
25932  Returns:
25933  - true - The BaudRateClock feature is supported on the device
25934  - false - The BaudRateClock feature is not supported on the device
25935  Remarks:
25936  None.
25937 */
25938 
25939 bool
25941  SPI_MODULE_ID index ) ;
25942 //******************************************************************************
25943 /* Function:
25944  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25945  Summary:
25946  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25947  Description:
25948  This function identifies whether the ErrorInterruptControl feature is available
25949  on the SPI module.
25950  When this function returns true, these functions are supported on the device:
25951  - PLIB_SPI_ErrorInterruptEnable
25952  - PLIB_SPI_ErrorInterruptDisable
25953  This operation is atomic.
25954  Preconditions:
25955  None.
25956  Parameters:
25957  index - Identifier for the device instance
25958  Returns:
25959  - true - The ErrorInterruptControl feature is supported on the device
25960  - false - The ErrorInterruptControl feature is not supported on the device
25961  Remarks:
25962  None.
25963 */
25964 
25965 bool
25967  SPI_MODULE_ID index ) ;
25968 //******************************************************************************
25969 /* Function:
25970  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25971  Summary:
25972  Identifies whether the AudioErrorControl feature exists on the SPI module.
25973  Description:
25974  This function identifies whether the AudioErrorControl feature is available
25975  on the SPI module.
25976  When this function returns true, these functions are supported on the device:
25977  - PLIB_SPI_AudioErrorEnable
25978  - PLIB_SPI_AudioErrorDisable
25979  This operation is atomic.
25980  Preconditions:
25981  None.
25982  Parameters:
25983  index - Identifier for the device instance
25984  Returns:
25985  - true - The AudioErrorControl feature is supported on the device
25986  - false - The AudioErrorControl feature is not supported on the device
25987  Remarks:
25988  None.
25989 */
25990 
25991 bool
25993  SPI_MODULE_ID index ) ;
25994 //******************************************************************************
25995 /* Function:
25996  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25997  Summary:
25998  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25999  Description:
26000  This function identifies whether the AudioProtocolControl feature is available
26001  on the SPI module.
26002  When this function returns true, this function is supported on the device:
26003  - PLIB_SPI_AudioProtocolEnable
26004  - PLIB_SPI_AudioProtocolDisable
26005  This operation is atomic.
26006  Preconditions:
26007  None.
26008  Parameters:
26009  index - Identifier for the device instance
26010  Returns:
26011  - true - The AudioProtocolControl feature is supported on the device
26012  - false - The AudioProtocolControl feature is not supported on the device
26013  Remarks:
26014  None.
26015 */
26016 
26017 bool
26019  SPI_MODULE_ID index ) ;
26020 //******************************************************************************
26021 /* Function:
26022  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26023  Summary:
26024  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26025  Description:
26026  This function identifies whether the AudioTransmitMode feature is available
26027  on the SPI module.
26028  When this function returns true, this function is supported on the device:
26029  - PLIB_SPI_AudioTransmitModeSelect
26030  This operation is atomic.
26031  Preconditions:
26032  None.
26033  Parameters:
26034  index - Identifier for the device instance
26035  Returns:
26036  - true - The AudioTransmitMode feature is supported on the device
26037  - false - The AudioTransmitMode feature is not supported on the device
26038  Remarks:
26039  None.
26040 */
26041 
26042 bool
26044  SPI_MODULE_ID index ) ;
26045 //******************************************************************************
26046 /* Function:
26047  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26048  Summary:
26049  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26050  Description:
26051  This function identifies whether the AudioProtocolMode feature is available
26052  on the SPI module.
26053  When this function returns true, this function is supported on the device:
26054  - PLIB_SPI_AudioProtocolModeSelect
26055  This operation is atomic.
26056  Preconditions:
26057  None.
26058  Parameters:
26059  index - Identifier for the device instance
26060  Returns:
26061  - true - The AudioProtocolMode feature is supported on the device
26062  - false - The AudioProtocolMode feature is not supported on the device
26063  Remarks:
26064  None.
26065 */
26066 
26067 bool
26069  SPI_MODULE_ID index ) ;
26070 //******************************************************************************
26071 /* Function:
26072  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26073  Summary:
26074  Identifies whether the Buffer32bit feature exists on the SPI module.
26075  Description:
26076  This function identifies whether the Buffer32bit feature is available on the
26077  SPI module.
26078  When this function returns true, these functions are supported on the device:
26079  - PLIB_SPI_BufferRead32bit
26080  - PLIB_SPI_BufferWrite32bit
26081  This operation is atomic.
26082  Preconditions:
26083  None.
26084  Parameters:
26085  index - Identifier for the device instance
26086  Returns:
26087  - true - The Buffer32bit feature is supported on the device
26088  - false - The Buffer32bit feature is not supported on the device
26089  Remarks:
26090  None.
26091 */
26092 
26093 bool
26095  SPI_MODULE_ID index ) ;
26096 //******************************************************************************
26097 /* Function:
26098  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26099  Summary:
26100  Identifies whether the Buffer16bit feature exists on the SPI module.
26101  Description:
26102  This function identifies whether the Buffer16bit feature is available on the
26103  SPI module.
26104  When this function returns true, these functions are supported on the device:
26105  - PLIB_SPI_BufferRead16bit
26106  - PLIB_SPI_BufferWrite16bit
26107  This operation is atomic.
26108  Preconditions:
26109  None.
26110  Parameters:
26111  index - Identifier for the device instance
26112  Returns:
26113  - true - The Buffer16bit feature is supported on the device
26114  - false - The Buffer16bit feature is not supported on the device
26115  Remarks:
26116  None.
26117 */
26118 
26119 bool
26121  SPI_MODULE_ID index ) ;
26122 //DOM-IGNORE-BEGIN
26123 //DOM-IGNORE-END
26124  // #ifndef _PLIB_SPI_H
26125 /*******************************************************************************
26126  End of File
26127  */
26128 
26129 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26130 /* CLOSE_FILE Include File */
26131 
26132  // SPI PLIB Header
26133 #include "system/common/sys_common.h" // Common System Service Definitions
26134 #include "system/common/sys_module.h" // Module/Driver Definitions
26135 #include "system/int/sys_int.h" // System Interrupt Definitions
26136 #include "system/clk/sys_clk.h"
26137 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26138  /* LDRA full path */
26139 // DOM-IGNORE-BEGIN
26140 // DOM-IGNORE-END
26141 // *****************************************************************************
26142 /* SPI Driver Buffer Handle
26143  Summary:
26144  Handle identifying a read or write buffer passed to the driver.
26145  Description:
26146  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26147  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26148  This handle is associated with the buffer passed into the function and
26149  it allows the application to track the completion of the data from (or into)
26150  that buffer. The buffer handle value returned from the "buffer add" function
26151  is returned back to the client by the "callback" function registered with
26152  the driver.
26153  The buffer handle assigned to a client request expires when the client has
26154  been notified of the completion of the buffer transfer (after event handler
26155  function that notifies the client returns) or after the buffer has been
26156  retired by the driver if no event handler callback was set.
26157  Remarks:
26158  None.
26159 */
26160 
26161 typedef
26162 uintptr_t
26164 // *****************************************************************************
26165 /* SPI Driver Invalid Buffer Handle
26166  Summary:
26167  Definition of an invalid buffer handle.
26168  Description:
26169  This is the definition of an invalid buffer handle. An invalid buffer handle
26170  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26171  function if the buffer add request was not successful.
26172  Remarks:
26173  None.
26174 */
26175 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26176 // *****************************************************************************
26177 /* SPI Driver Module Index Numbers
26178  Summary:
26179  SPI driver index definitions.
26180  Description:
26181  These constants provide the SPI driver index definitions.
26182  Remarks:
26183  These constants should be used in place of hard-coded numeric literals.
26184  These values should be passed into the DRV_SPI_Initialize and
26185  DRV_SPI_Open functions to identify the driver instance in use.
26186 */
26187 #define DRV_SPI_INDEX_0 0
26188 #define DRV_SPI_INDEX_1 1
26189 #define DRV_SPI_INDEX_2 2
26190 #define DRV_SPI_INDEX_3 3
26191 #define DRV_SPI_INDEX_4 4
26192 #define DRV_SPI_INDEX_5 5
26193 // *****************************************************************************
26194 /* SPI Driver Module Index Count
26195  Summary:
26196  Number of valid SPI driver indices.
26197  Description:
26198  This constant identifies the number of valid SPI driver indices.
26199  Remarks:
26200  This constant should be used in place of hard-coded numeric literals.
26201  This value is derived from device-specific header files defined as part
26202  of the peripheral libraries.
26203 */
26204 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26205 // *****************************************************************************
26206 /* SPI Clock Mode Selection
26207  Summary:
26208  Identifies the various clock modes of the SPI module.
26209  Description:
26210  This enumeration identifies the various clock modes of the SPI module.
26211  Remarks:
26212  None.
26213 */
26214 
26215 typedef
26216  enum
26217  {
26218  /* SPI Clock Mode 0:
26219  - Idle State of the clock is Low
26220  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26221  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26223  /*DOM-IGNORE-BEGIN*/
26224  = 0 /*DOM-IGNORE-END*/
26225  ,
26226  /* SPI Clock Mode 1:
26227  - Idle State of the clock is Low
26228  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26229  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26231  /*DOM-IGNORE-BEGIN*/
26232  = 1 /*DOM-IGNORE-END*/
26233  ,
26234  /* SPI Clock Mode 2:
26235  - Idle State of the clock is High
26236  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26237  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26239  /*DOM-IGNORE-BEGIN*/
26240  = 2 /*DOM-IGNORE-END*/
26241  ,
26242  /* SPI Clock Mode 3:
26243  - Idle State of the clock is High
26244  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26245  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26247  /*DOM-IGNORE-BEGIN*/
26248  = 3 /*DOM-IGNORE-END*/
26249  } DRV_SPI_CLOCK_MODE ;
26250 // *****************************************************************************
26251 /* SPI Buffer Type Selection
26252  Summary:
26253  Identifies the various buffer types of the SPI module.
26254  Description:
26255  This enumeration identifies the various buffer types of the SPI module.
26256  Remarks:
26257  None.
26258 */
26259 
26260 typedef
26261  enum
26262  {
26263  /* SPI Buffer Type Standard */
26265  /*DOM-IGNORE-BEGIN*/
26266  = 0 /*DOM-IGNORE-END*/
26267  ,
26268  /* SPI Enhanced Buffer Type */
26270  /*DOM-IGNORE-BEGIN*/
26271  = 1 /*DOM-IGNORE-END*/
26273 // *****************************************************************************
26274 /* SPI Protocols Enumeration
26275  Summary:
26276  Identifies the various protocols of the SPI module.
26277  Description:
26278  This enumeration identifies the various protocols of the SPI module.
26279  Remarks:
26280  None.
26281 */
26282 
26283 typedef
26284  enum
26285  {
26286  /* SPI Protocol Type Standard */
26288  /*DOM-IGNORE-BEGIN*/
26289  = 0 /*DOM-IGNORE-END*/
26290  ,
26291  /* SPI Protocol Type Framed */
26293  /*DOM-IGNORE-BEGIN*/
26294  = 1 /*DOM-IGNORE-END*/
26295  ,
26296  /*SPI Protocol Type Audio*/
26298  /*DOM-IGNORE-BEGIN*/
26299  = 2 /*DOM-IGNORE-END*/
26301 // *****************************************************************************
26302 /* SPI Driver Buffer Events
26303  Summary
26304  Identifies the possible events that can result from a buffer add request.
26305  Description
26306  This enumeration identifies the possible events that can result from a
26307  buffer add request caused by the client calling either
26308  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26309  Remarks:
26310  One of these values is passed in the "event" parameter of the event
26311  handling callback function that the client registered during buffer add
26312  requests.
26313 */
26314 
26315 typedef
26316  enum
26317  {
26318  /* Buffer is pending to get processed */
26320  /* Buffer is being processed */
26322  /* All data from or to the buffer was transferred successfully. */
26324  /* There was an error while processing the buffer transfer request. */
26327 // *****************************************************************************
26328 /* SPI Usage Modes Enumeration
26329  Summary:
26330  Identifies the various usage modes of the SPI module.
26331  Description:
26332  This enumeration identifies the various usage modes of the SPI module.
26333  Remarks:
26334  None.
26335 */
26336 
26337 typedef
26338  enum
26339  {
26340  /* SPI Mode Master */
26342  /*DOM-IGNORE-BEGIN*/
26343  = 0 /*DOM-IGNORE-END*/
26344  ,
26345  /* SPI Mode Slave */
26347  /*DOM-IGNORE-BEGIN*/
26348  = 1 /*DOM-IGNORE-END*/
26349  } DRV_SPI_MODE ;
26350 // *****************************************************************************
26351 /* SPI Task Modes Enumeration
26352  Summary:
26353  Identifies the various modes of how the tasks function will be run.
26354  Description:
26355  This enumeration identifies the various tasks mode
26356  Remarks:
26357  None.
26358 */
26359 
26360 typedef
26361  enum
26362  {
26363  /* Task is configured to run in polled mode */
26365  /*DOM-IGNORE-BEGIN*/
26366  = 0 /*DOM-IGNORE-END*/
26367  ,
26368  /* Task is configured to run in interrupt mode */
26370  /*DOM-IGNORE-BEGIN*/
26371  = 1 /*DOM-IGNORE-END*/
26372  } DRV_SPI_TASK_MODE ;
26373 // *****************************************************************************
26374 /* SPI Driver Buffer Event Handler Function Pointer
26375  Summary:
26376  Pointer to a SPI Driver Buffer Event handler function
26377  Description:
26378  This data type defines the required function signature for the SPI driver
26379  buffer event handling callback function. A client must register a pointer
26380  to a buffer event handling function who's function signature (parameter
26381  and return value types) match the types specified by this function pointer
26382  in order to receive buffer related event calls back from the driver.
26383  The parameters and return values and return value are described here and
26384  a partial example implementation is provided.
26385  Parameters:
26386  event - Identifies the type of event
26387  bufferHandle - Handle identifying the buffer to which the vent relates
26388  context - Value identifying the context of the application that
26389  registered the event handling function.
26390  Returns:
26391  None.
26392  Example:
26393  <code>
26394  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26395  DRV_SPI_BUFFER_HANDLE bufferHandle,
26396  uintptr_t context )
26397  {
26398  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26399  switch(event)
26400  {
26401  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26402  // Handle the completed buffer.
26403  break;
26404  case DRV_SPI_BUFFER_EVENT_ERROR:
26405  default:
26406  // Handle error.
26407  break;
26408  }
26409  }
26410  </code>
26411  Remarks:
26412  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26413  transferred successfully.
26414  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26415  not transferred successfully.
26416  The bufferHandle parameter contains the buffer handle of the buffer that
26417  failed.
26418  The context parameter contains the a handle to the client context,
26419  provided at the time the event handling function registration.
26420  This context handle value is passed back to the client as the "context"
26421  parameter. It can be any value necessary to identify the client context
26422  or instance (such as a pointer to the client's data) instance of the
26423  client that made the buffer add request.
26424  The event handler function executes in an interrupt context when the driver
26425  is configured for interrupt mode operation. It is recommended of the
26426  application to not perform process intensive operations with in this
26427  function.
26428 */
26429 
26430 typedef
26432 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26433 void * context ) ;
26434 // *****************************************************************************
26435 /* SPI Driver Initialization Data
26436  Summary:
26437  Defines the data required to initialize or reinitialize the SPI driver
26438  Description:
26439  This data type defines the data required to initialize or reinitialize the
26440  SPI driver. If the driver is built statically, the members of this data
26441  structure are statically over-ridden by static override definitions in the
26442  system_config.h file.
26443  Remarks:
26444  None.
26445 */
26446 
26447 typedef
26448 struct _DRV_SPI_INIT
26449 {
26450  /* System module initialization */
26451  SYS_MODULE_INIT moduleInit ;
26452  /* Identifies peripheral (PLIB-level) ID */
26453  SPI_MODULE_ID spiId ;
26454  /* SPI Task Mode Type*/
26456  /* SPI Usage Mode Type */
26458  /* Allow SPI to run when CPU goes to idle mode*/
26459  bool allowIdleRun ;
26460  /* SPI Protocol Type */
26462  /* SPI Slave Mode SSx Pin Select */
26463  bool spiSlaveSSPin ;
26464  /* Framed mode Sync Pulse*/
26465  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26466  /* Framed Mode pulse polarity*/
26467  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26468  /* Framed Mode Pulse Direction*/
26469  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26470  /* Framed mode Pulse Edge*/
26471  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26472  /* Framed Mode Pulse width */
26473  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26474  /* Audio mode transmit mode*/
26475  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26476  /* Audio mode protocol mode*/
26477  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26478  /* Communication Width */
26479  SPI_COMMUNICATION_WIDTH commWidth ;
26480  /* SPI clock source which generates required baud rate.
26481  It can be either PBCLK or Reference Clock */
26482  SPI_BAUD_RATE_CLOCK baudClockSource ;
26483  /* when Baud rate clock source is peripheral clock, then this element is
26484  used to define which peripheral bus clock is used for this particular
26485  SPI instance. */
26486  CLK_BUSES_PERIPHERAL spiClk ;
26487  /* Baud Rate Value */
26488  uint32_t baudRate ;
26489  /* SPI Buffer Type */
26491  /* SPI Clock mode */
26493  /* SPI Input Sample Phase Selection */
26494  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26495  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26496  INT_SOURCE txInterruptSource ;
26497  /* Receive Interrupt Source for SPI module */
26498  INT_SOURCE rxInterruptSource ;
26499  /* Error Interrupt Source for SPI module */
26500  INT_SOURCE errInterruptSource ;
26501  /* While using standard buffer and polled mode how many transfers to do
26502  before yielding to other tasks*/
26503  uint8_t numTrfsSmPolled ;
26504  /* Dummy byte value which will be used for dummy transmission */
26505  uint32_t dummyByteValue ;
26506  /* This is the buffer queue size. This is the maximum
26507  number of transfer requests that driver will queue. */
26508  uint8_t queueSize ;
26509  /* This controls the minimum number of jobs that the driver will be able
26510  to accept without running out of memory. The driver will reserve this
26511  number of jobs from the global SPI queue so that it will always be available*/
26512  uint8_t jobQueueReserveSize ;
26513  /* This callback is fired when an operation is about to start on the
26514  SPI bus. This allows the user to set any pins that need to be set.
26515  This callback may be called from an ISR so should not include OSAL
26516  calls. The context parameter is the same one passed into the
26517  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26518  */
26520  /* This callback is fired when an operation has just completed on the
26521  SPI bus. This allows the user to set any pins that need to be set.
26522  This callback may be called from an ISR so should not include OSAL
26523  calls. The context parameter is the same one passed into the
26524  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26525  */
26527 } DRV_SPI_INIT ;
26528 // *****************************************************************************
26529 /* SPI Driver Client Specific Configuration
26530  Summary:
26531  Defines the data that can be changed per client.
26532  Description:
26533  This data type defines the data can be configured per client. This data can
26534  be per client, and overrides the configuration data contained inside of
26535  DRV_SPI_INIT.
26536  Remarks:
26537  None.
26538 */
26539 
26540 typedef
26541 struct _DRV_SPI_CLIENT_DATA
26542 {
26543  /* Baud Rate Value */
26544  uint32_t baudRate ;
26545  /* This callback is fired when an operation is about to start on the
26546  SPI bus. This allows the user to set any pins that need to be set.
26547  This callback may be called from an ISR so should not include OSAL
26548  calls. The context parameter is the same one passed into the
26549  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26550  */
26552  /* This callback is fired when an operation has just completed on the
26553  SPI bus. This allows the user to set any pins that need to be set.
26554  This callback may be called from an ISR so should not include OSAL
26555  calls. The context parameter is the same one passed into the
26556  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26557  */
26560 //DOM-IGNORE-BEGIN
26561 //DOM-IGNORE-END
26562  // #ifndef _DRV_SPI_DEFINITIONS_H
26563 /*******************************************************************************
26564  End of File
26565 */
26566 
26567 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26568 /* CLOSE_FILE Include File */
26569 
26570 // DOM-IGNORE-BEGIN
26571 // DOM-IGNORE-END
26572 // *****************************************************************************
26573 // *****************************************************************************
26574 // Section: Interface Routines - System Level
26575 // *****************************************************************************
26576 // *****************************************************************************
26577 // *****************************************************************************
26578 /* Function:
26579  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26580  const SYS_MODULE_INIT * const init )
26581  Summary:
26582  Initializes the SPI instance for the specified driver index.
26583  <p><b>Implementation:</b> Static/Dynamic</p>
26584  Description:
26585  This routine initializes the SPI driver instance for the specified driver
26586  index, making it ready for clients to open and use it. The initialization
26587  data is specified by the 'init' parameter. The initialization may fail if the
26588  number of driver objects allocated are insufficient or if the specified
26589  driver instance is already initialized. The driver instance index is
26590  independent of the SPI module ID. For example, driver instance 0 can be
26591  assigned to SPI2. If the driver is built statically, then some of the
26592  initialization parameters are overridden by configuration macros. Refer to
26593  the description of the DRV_SPI_INIT data structure for more details on
26594  which members on this data structure are overridden.
26595  Precondition:
26596  None.
26597  Parameters:
26598  index - Identifier for the instance to be initialized. Please note this
26599  is not the SPI id. The hardware SPI id is set in the initialization
26600  structure. This is the index of the driver index to use.
26601  init - Pointer to a data structure containing any data necessary to
26602  initialize the driver. If this pointer is NULL, the driver
26603  uses the static initialization override macros for each
26604  member of the initialization data structure.
26605  Returns:
26606  - If successful - returns a valid handle to a driver instance object
26607  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26608  Example:
26609  <code>
26610  DRV_SPI_INIT init;
26611  SYS_MODULE_OBJ objectHandle;
26612  // Populate the SPI initialization structure
26613  init.spiId = SPI_ID_1,
26614  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26615  init.spiMode = DRV_SPI_MODE_MASTER,
26616  init.allowIdleRun = false,
26617  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26618  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26619  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26620  init.spiClk = CLK_BUS_PERIPHERAL_2,
26621  init.baudRate = 10000000,
26622  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26623  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26624  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26625  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26626  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26627  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26628  init.dummyByteValue = 0xFF,
26629  init.queueSize = 10,
26630  init.jobQueueReserveSize = 1,
26631  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26632  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26633  {
26634  // Handle error
26635  }
26636  </code>
26637  Remarks:
26638  This routine must be called before any other SPI routine is called.
26639  This routine should only be called once during system initialization
26640  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26641  instance. This routine will NEVER block for hardware access.
26642 */
26643 
26644 SYS_MODULE_OBJ
26646  const SYS_MODULE_INDEX index ,
26647  const SYS_MODULE_INIT * const init ) ;
26648 //*************************************************************************
26649 /* Function:
26650  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26651  Summary:
26652  Deinitializes the specified instance of the SPI driver module.
26653  <p><b>Implementation:</b> Static/Dynamic</p>
26654  Description:
26655  Deinitializes the specified instance of the SPI driver module,
26656  disabling its operation (and any hardware) and invalidates all of the
26657  internal data.
26658  Precondition:
26659  Function DRV_SPI_Initialize must have been called before calling this
26660  routine and a valid SYS_MODULE_OBJ must have been returned.
26661  Parameters:
26662  object - Driver object handle, returned from DRV_SPI_Initialize
26663  Returns:
26664  None.
26665  Example:
26666  <code>
26667  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26668  SYS_STATUS status;
26669  DRV_SPI_Deinitialize ( object );
26670  status = DRV_SPI_Status( object );
26671  if( SYS_MODULE_UNINITIALIZED == status )
26672  {
26673  // Check again later if you need to know
26674  // when the driver is deinitialized.
26675  }
26676  </code>
26677  Remarks:
26678  Once the Initialize operation has been called, the De-initialize
26679  operation must be called before the Initialize operation can be called
26680  again.
26681  This function will NEVER block waiting for hardware. If the operation
26682  requires time to allow the hardware to complete, this will be reported
26683  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26684  to find out when the module is in the ready state.
26685 */
26686 
26687 void
26689  SYS_MODULE_OBJ object ) ;
26690 //**************************************************************************
26691 /* Function:
26692  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26693  Summary:
26694  Provides the current status of the SPI driver module.
26695  <p><b>Implementation:</b> Static/Dynamic</p>
26696  Description:
26697  This function provides the current status of the SPI driver module.
26698  Precondition:
26699  The DRV_SPI_Initialize function must have been called before calling
26700  this function.
26701  Parameters:
26702  object - Driver object handle, returned from DRV_SPI_Initialize
26703  Returns:
26704  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26705  system level operation and cannot start another
26706  Example:
26707  <code>
26708  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26709  SYS_STATUS status;
26710  status = DRV_SPI_Status( object );
26711  if( SYS_STATUS_READY != status )
26712  {
26713  // Handle error
26714  }
26715  </code>
26716  Remarks:
26717  Any value greater than SYS_STATUS_READY is also a normal running state
26718  in which the driver is ready to accept new operations.
26719  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26720  deinitialized
26721  This value is less than SYS_STATUS_ERROR.
26722  This function can be used to determine when any of the driver's module
26723  level operations has completed.
26724  If the status operation returns SYS_STATUS_BUSY, the previous operation
26725  has not yet completed. Once the status operation returns
26726  SYS_STATUS_READY, any previous operations have completed.
26727  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26728  that is also an error state.
26729  This function will NEVER block waiting for hardware.
26730  If the Status operation returns an error value, the error may be
26731  cleared by calling the reinitialize operation. If that fails, the
26732  deinitialize operation will need to be called, followed by the
26733  initialize operation to return to normal operations.
26734 */
26735 
26736 SYS_STATUS
26737  DRV_SPI_Status (
26738  SYS_MODULE_OBJ object ) ;
26739 // *****************************************************************************
26740 /* Function:
26741  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26742  Summary:
26743  Maintains the driver's state machine and implements its ISR.
26744  <p><b>Implementation:</b> Static/Dynamic</p>
26745  Description:
26746  This routine is used to maintain the driver's internal state
26747  machine and implement its transmit ISR for interrupt-driven implementations.
26748  In polling mode, this function should be called from the SYS_Tasks()
26749  function. In interrupt mode, this function should be called in the transmit
26750  interrupt service routine of the USART that is associated with this USART
26751  driver hardware instance.
26752  Precondition:
26753  The DRV_SPI_Initialize routine must have been called for the specified
26754  SPI driver instance.
26755  Parameters:
26756  object - Object handle for the specified driver instance (returned from
26757  DRV_SPI_Initialize)
26758  Returns:
26759  None.
26760  Example:
26761  <code>
26762  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26763  while( true )
26764  {
26765  DRV_SPI_Tasks ( object );
26766  // Do other tasks
26767  }
26768  </code>
26769  Remarks:
26770  This function is normally not called directly by an application. It is
26771  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26772  ISR.
26773  This function may execute in an ISR context and will never block or access any
26774  resources that may cause it to block.
26775 */
26776 
26777 void
26778  DRV_SPI_Tasks (
26779  SYS_MODULE_OBJ object ) ;
26780 // *****************************************************************************
26781 // *****************************************************************************
26782 // Section: Interface Routines - Client Level
26783 // *****************************************************************************
26784 // *****************************************************************************
26785 //**************************************************************************
26786 /* Function:
26787  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26788  const DRV_IO_INTENT ioIntent )
26789  Summary:
26790  Opens the specified SPI driver instance and returns a handle to it.
26791  <p><b>Implementation:</b> Static/Dynamic</p>
26792  Description:
26793  This routine opens the specified SPI driver instance and provides a
26794  handle that must be provided to all other client-level operations to
26795  identify the caller and the instance of the driver. The ioIntent
26796  parameter defines how the client interacts with this driver instance.
26797  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26798  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26799  able to write to the driver. If the ioIntent in
26800  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26801  write.
26802  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26803  exclusive access to this client. The driver cannot be opened by any
26804  other client.
26805  Precondition:
26806  The DRV_SPI_Initialize function must have been called before calling
26807  this function.
26808  Parameters:
26809  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26810  Please note this is not the SPI ID.
26811  ioIntent - Zero or more of the values from the enumeration
26812  DRV_IO_INTENT ORed together to indicate the intended use of
26813  the driver
26814  Returns:
26815  If successful, the routine returns a valid open-instance handle (a
26816  number identifying both the caller and the module instance).
26817  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26818  can occur when the following is true:
26819  * if the number of client objects allocated via
26820  DRV_SPI_INSTANCES_NUMBER is insufficient
26821  * if the client is trying to open the driver but driver has been
26822  opened exclusively by another client
26823  * if the driver hardware instance being opened is not initialized or
26824  is invalid
26825  Example:
26826  <code>
26827  DRV_HANDLE handle;
26828  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26829  if( DRV_HANDLE_INVALID == handle )
26830  {
26831  // Unable to open the driver
26832  }
26833  </code>
26834  Remarks:
26835  The handle returned is valid until the DRV_SPI_Close routine is
26836  called. This routine will NEVER block waiting for hardware. If the
26837  requested intent flags are not supported, the routine will return
26838  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26839  It should not be called in an ISR.
26840 */
26841 
26842 DRV_HANDLE
26843  DRV_SPI_Open (
26844  const SYS_MODULE_INDEX drvIndex ,
26845  const DRV_IO_INTENT ioIntent ) ;
26846 //**************************************************************************
26847 /* Function:
26848  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26849  const DRV_SPI_CLIENT_DATA * cfgData )
26850  Summary:
26851  Configures a SPI client with specific data.
26852  <p><b>Implementation:</b> Static/Dynamic</p>
26853  Description:
26854  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26855  Whenever a new SPI job is started these values will be used. Passing in NULL will
26856  reset the client back to configuration parameters passed to driver initialization.
26857  A zero in any of the structure elements will reset that specific configuration back
26858  to the driver default.
26859  Precondition:
26860  The DRV_SPI_Open function must have been called before calling
26861  this function.
26862  Parameters:
26863  handle - handle of the client returned by DRV_SPI_Open.
26864  cfgData - Client-specific configuration data.
26865  Returns:
26866  - If successful - the routing will return greater than or equal to zero
26867  - If an error occurs - the return value is negative
26868 */
26869 
26870 int32_t
26872  DRV_HANDLE handle ,
26873  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26874 // *****************************************************************************
26875 /* Function:
26876  void DRV_SPI_Close ( DRV_HANDLE handle )
26877  Summary:
26878  Closes an opened instance of the SPI driver.
26879  <p><b>Implementation:</b> Static/Dynamic</p>
26880  Description:
26881  This function closes an opened instance of the SPI driver, invalidating the
26882  handle.
26883  Precondition:
26884  The DRV_SPI_Initialize routine must have been called for the specified
26885  SPI driver instance.
26886  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26887  Parameters:
26888  handle - A valid open-instance handle, returned from the driver's
26889  open routine
26890  Returns:
26891  None.
26892  Example:
26893  <code>
26894  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26895  DRV_SPI_Close ( handle );
26896  </code>
26897  Remarks:
26898  After calling this routine, the handle passed in "handle" must not be used
26899  with any of the remaining driver routines. A new handle must be obtained by
26900  calling DRV_SPI_Open before the caller may use the driver again. This
26901  function is thread safe in a RTOS application.
26902  Note:
26903  Usually there is no need for the driver client to verify that the Close
26904  operation has completed.
26905 */
26906 
26907 void
26908  DRV_SPI_Close (
26909  DRV_HANDLE handle ) ;
26910 // *****************************************************************************
26911 // *****************************************************************************
26912 // Section: Interface Routines - Client level Read & Write APIs
26913 // *****************************************************************************
26914 // *****************************************************************************
26915 /* These are non-blocking APIs. It doesn't wait until the operation gets
26916  finished. The actual operation will happen it the task routine. The status of
26917  this operation can be monitored using DRV_SPI_BufferStatus function. In
26918  polling mode, User must ensure that the code gets time to execute the task
26919  routine. */
26920 //*******************************************************************************
26921 /* Function:
26922  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26923  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26924  void * context )
26925  Summary:
26926  Registers a buffer for a read operation. Actual transfer will happen in
26927  the Task function.
26928  <p><b>Implementation:</b> Static/Dynamic</p>
26929  Description:
26930  Registers a buffer for a read operation. Actual transfer will happen in
26931  the Task function. The status of this operation can be monitored using
26932  DRV_SPI_BufferStatus function. A optional callback can also be
26933  provided that will be called when the operation is complete.
26934  Precondition:
26935  The DRV_SPI_Initialize routine must have been called for the specified
26936  SPI driver instance.
26937  DRV_SPI_Open must have been called to obtain a valid opened device
26938  handle.
26939  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26940  in the DRV_SPI_Open call.
26941  Parameters:
26942  handle - A valid open-instance handle, returned from the driver's
26943  open routine
26944  rxBuffer - The buffer to which the data should be written to.
26945  size - Number of bytes to be read from the SPI bus.
26946  completeCB - Pointer to a function to be called when this queued operation is complete.
26947  context - unused by the driver but this is passed to the callback when it is called.
26948  Returns:
26949  If the buffer add request is successful, a valid buffer handle is returned.
26950  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26951  Example:
26952  <code>
26953  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26954  char myBuffer[MY_BUFFER_SIZE], state = 0;
26955  DRV_SPI_BUFFER_HANDLE bufferHandle;
26956  switch ( state )
26957  {
26958  case 0:
26959  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26960  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26961  {
26962  state++;
26963  }
26964  break;
26965  case 1:
26966  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26967  {
26968  state++;
26969  // All transmitter data has been sent successfully.
26970  }
26971  break;
26972  }
26973  </code>
26974  Remarks:
26975  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26976  instead of it.
26977  */
26978 
26981  DRV_HANDLE handle ,
26982  void * rxBuffer ,
26983  size_t size ,
26984  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26985  void * context ) ;
26986 //*******************************************************************************
26987 /* Function:
26988  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26989  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26990  void * context )
26991  Summary:
26992  Registers a buffer for a write operation. Actual transfer will happen
26993  in the Task function.
26994  <p><b>Implementation:</b> Static/Dynamic</p>
26995  Description:
26996  Registers a buffer for a write operation. Actual transfer will happen
26997  in the Task function. The status of this operation can be monitored
26998  using DRV_SPI_BufferStatus function. A optional callback can also be
26999  provided that will be called when the operation is complete.
27000  Precondition:
27001  The DRV_SPI_Initialize routine must have been called for the specified
27002  SPI driver instance.
27003  DRV_SPI_Open must have been called to obtain a valid opened device
27004  handle.
27005  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27006  in the DRV_SPI_Open call.
27007  Parameters:
27008  handle - A valid open-instance handle, returned from the driver's
27009  open routine
27010  txBuffer - The buffer which hold the data.
27011  size - Number of bytes to be written to the SPI bus.
27012  completeCB - Pointer to a function to be called when this queued operation is complete
27013  context - unused by the driver but this is passed to the callback when it is called
27014  Returns:
27015  If the buffer add request is successful, a valid buffer handle is returned.
27016  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27017  Example:
27018  <code>
27019  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27020  char myBuffer[MY_BUFFER_SIZE], state = 0;
27021  DRV_SPI_BUFFER_HANDLE bufferHandle;
27022  switch ( state )
27023  {
27024  case 0:
27025  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27026  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27027  {
27028  state++;
27029  }
27030  break;
27031  case 1:
27032  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27033  {
27034  state++;
27035  // All transmitter data has been sent successfully.
27036  }
27037  break;
27038  }
27039  </code>
27040  Remarks:
27041  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27042  instead of it.
27043 */
27044 
27047  DRV_HANDLE handle ,
27048  void * txBuffer ,
27049  size_t size ,
27050  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27051  void * context ) ;
27052 //*******************************************************************************
27053 /* Function:
27054  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27055  void *txBuffer, void *rxBuffer, size_t size, )
27056  Summary:
27057  Registers a buffer for a read and write operation. Actual transfer will
27058  happen in the Task function.
27059  <p><b>Implementation:</b> Static/Dynamic</p>
27060  Description:
27061  Registers a buffer for a read and write operation. Actual transfer will
27062  happen in the Task function. The status of this operation can be
27063  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27064  provided that will be called when the operation is complete.
27065  Precondition:
27066  The DRV_SPI_Initialize routine must have been called for the specified
27067  SPI driver instance.
27068  DRV_SPI_Open must have been called to obtain a valid opened device
27069  handle.
27070  Parameters:
27071  handle - A valid open-instance handle, returned from the driver's
27072  open routine
27073  txBuffer - The buffer which hold the data.
27074  txSize - Number of bytes to be written to the SPI bus.
27075  rxBuffer - The buffer to which the data should be written to.
27076  rxSize - Number of bytes to be read from the SPI bus
27077  completeCB - Pointer to a function to be called when this queued operation is complete
27078  context - unused by the driver but this is passed to the callback when it is called
27079  Returns:
27080  If the buffer add request is successful, a valid buffer handle is returned.
27081  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27082  Example:
27083  <code>
27084  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27085  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27086  DRV_SPI_BUFFER_HANDLE bufferHandle;
27087  switch ( state )
27088  {
27089  case 0:
27090  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27091  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27092  {
27093  state++;
27094  }
27095  break;
27096  case 1:
27097  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27098  {
27099  state++;
27100  // All transmitter data has been sent successfully.
27101  }
27102  break;
27103  }
27104  </code>
27105  Remarks:
27106  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27107  instead of it.
27108 */
27109 
27112  DRV_HANDLE handle ,
27113  void * txBuffer ,
27114  size_t txSize ,
27115  void * rxBuffer ,
27116  size_t rxSize ,
27117  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27118  void * context ) ;
27119 //*******************************************************************************
27120 /* Function:
27121  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27122  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27123  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27124  Summary:
27125  Registers a buffer for a read operation. Actual transfer will happen in
27126  the Task function.
27127  <p><b>Implementation:</b> Static/Dynamic</p>
27128  Description:
27129  Registers a buffer for a read operation. Actual transfer will happen in
27130  the Task function. The status of this operation can be monitored using
27131  DRV_SPI_BufferStatus function. A optional callback can also be
27132  provided that will be called when the operation is complete.
27133  Precondition:
27134  The DRV_SPI_Initialize routine must have been called for the specified
27135  SPI driver instance.
27136  DRV_SPI_Open must have been called to obtain a valid opened device
27137  handle.
27138  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27139  in the DRV_SPI_Open call.
27140  Parameters:
27141  handle - A valid open-instance handle, returned from the driver's
27142  open routine
27143  rxBuffer - The buffer to which the data should be written to.
27144  size - Number of bytes to be read from the SPI bus.
27145  completeCB - Pointer to a function to be called when this queued operation is complete
27146  context - unused by the driver but this is passed to the callback when it is called
27147  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27148  Returns:
27149  If the buffer add request is successful, a valid buffer handle is returned.
27150  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27151  Example:
27152  <code>
27153  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27154  char myBuffer[MY_BUFFER_SIZE], state = 0;
27155  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27156  switch ( state )
27157  {
27158  case 0:
27159  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27160  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27161  {
27162  state++;
27163  }
27164  break;
27165  case 1:
27166  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27167  {
27168  state++;
27169  // All transmitter data has been sent successfully.
27170  }
27171  break;
27172  }
27173  </code>
27174  Remarks:
27175  None.
27176  */
27177 
27180  DRV_HANDLE handle ,
27181  void * rxBuffer ,
27182  size_t size ,
27183  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27184  void * context ,
27185  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27186 //*******************************************************************************
27187 /* Function:
27188  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27189  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27190  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27191  Summary:
27192  Registers a buffer for a write operation. Actual transfer will happen
27193  in the Task function.
27194  <p><b>Implementation:</b> Static/Dynamic</p>
27195  Description:
27196  Registers a buffer for a write operation. Actual transfer will happen
27197  in the Task function. The status of this operation can be monitored
27198  using DRV_SPI_BufferStatus function. A optional callback can also be
27199  provided that will be called when the operation is complete.
27200  Precondition:
27201  The DRV_SPI_Initialize routine must have been called for the specified
27202  SPI driver instance.
27203  DRV_SPI_Open must have been called to obtain a valid opened device
27204  handle.
27205  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27206  in the DRV_SPI_Open call.
27207  Parameters:
27208  handle - A valid open-instance handle, returned from the driver's
27209  open routine
27210  txBuffer - The buffer which hold the data.
27211  size - Number of bytes to be written to the SPI bus.
27212  completeCB - Pointer to a function to be called when this queued operation is complete
27213  context - unused by the driver but this is passed to the callback when it is called
27214  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27215  Returns:
27216  If the buffer add request is successful, a valid buffer handle is returned.
27217  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27218  Example:
27219  <code>
27220  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27221  char myBuffer[MY_BUFFER_SIZE], state = 0;
27222  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27223  switch ( state )
27224  {
27225  case 0:
27226  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27227  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27228  {
27229  state++;
27230  }
27231  break;
27232  case 1:
27233  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27234  {
27235  state++;
27236  // All transmitter data has been sent successfully.
27237  }
27238  break;
27239  }
27240  </code>
27241  Remarks:
27242  None.
27243 */
27244 
27247  DRV_HANDLE handle ,
27248  void * txBuffer ,
27249  size_t size ,
27250  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27251  void * context ,
27252  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27253 //*******************************************************************************
27254 /* Function:
27255  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27256  void *txBuffer, void *rxBuffer, size_t size,
27257  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27258  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27259  Summary:
27260  Registers a buffer for a read and write operation. Actual transfer will
27261  happen in the Task function.
27262  <p><b>Implementation:</b> Static/Dynamic</p>
27263  Description:
27264  Registers a buffer for a read and write operation. Actual transfer will
27265  happen in the Task function. The status of this operation can be
27266  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27267  provided that will be called when the operation is complete.
27268  Precondition:
27269  The DRV_SPI_Initialize routine must have been called for the specified
27270  SPI driver instance.
27271  DRV_SPI_Open must have been called to obtain a valid opened device
27272  handle.
27273  Parameters:
27274  handle - A valid open-instance handle, returned from the driver's
27275  open routine
27276  txBuffer - The buffer which hold the data.
27277  txSize - Number of bytes to be written to the SPI bus.
27278  rxBuffer - The buffer to which the data should be written to.
27279  rxSize - Number of bytes to be read from the SPI bus
27280  completeCB - Pointer to a function to be called when this queued operation is complete
27281  context - unused by the driver but this is passed to the callback when it is called
27282  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27283  Returns:
27284  If the buffer add request is successful, a valid buffer handle is returned.
27285  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27286  Example:
27287  <code>
27288  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27289  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27290  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27291  switch ( state )
27292  {
27293  case 0:
27294  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27295  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27296  {
27297  state++;
27298  }
27299  break;
27300  case 1:
27301  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27302  {
27303  state++;
27304  // All transmitter data has been sent successfully.
27305  }
27306  break;
27307  }
27308  </code>
27309  Remarks:
27310  None.
27311 */
27312 
27315  DRV_HANDLE handle ,
27316  void * txBuffer ,
27317  size_t txSize ,
27318  void * rxBuffer ,
27319  size_t rxSize ,
27320  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27321  void * context ,
27322  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27323 // *****************************************************************************
27324 /* Function:
27325  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27326  Summary:
27327  Returns the transmitter and receiver transfer status.
27328  <p><b>Implementation:</b> Static/Dynamic</p>
27329  Description:
27330  This returns the transmitter and receiver transfer status.
27331  Precondition:
27332  The DRV_SPI_Initialize routine must have been called for the specified
27333  SPI driver instance.
27334  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27335  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27336  the buffer handle associated with that transfer.
27337  Parameters:
27338  bufferHandle - A valid buffer handle, returned from the driver's
27339  data transfer routine
27340  Returns:
27341  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27342  transfer.
27343  Example:
27344  <code>
27345  // Buffer handle returned from the data transfer function
27346  DRV_SPI_BUFFER_HANDLE bufferHandle;
27347  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27348  {
27349  // All transmitter data has been sent.
27350  }
27351  </code>
27352  Remarks:
27353  The returned status may contain a value with more than one of the bits
27354  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27355  should perform an AND with the bit of interest and verify if the
27356  result is non-zero (as shown in the example) to verify the desired status
27357  bit.
27358 */
27359 
27362  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27363 // *****************************************************************************
27364 /* Function:
27365  bool DRV_SPIn_ReceiverBufferIsFull(void)
27366  Summary:
27367  Returns the receive buffer status. 'n' represents the instance of the
27368  SPI driver used.
27369  <p><b>Implementation:</b> Static</p>
27370  Description:
27371  This function returns the receive buffer status (full/empty).
27372  Precondition:
27373  None.
27374  Parameters:
27375  None.
27376  Returns:
27377  Receive Buffer Status
27378  - 1 - Full
27379  - 0 - Empty
27380  Example:
27381  <code>
27382  bool rxBufStat;
27383  // Using instance 1 of SPI driver, that is n = 1
27384  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27385  if (rxBufStat)
27386  {
27387  ...
27388  }
27389  </code>
27390  Remarks:
27391  None.
27392 */
27393 
27394 bool
27396 // *****************************************************************************
27397 /* Function:
27398  bool DRV_SPIn_TransmitterBufferIsFull(void)
27399  Summary:
27400  Returns the transmit buffer status. 'n' represents the instance of the
27401  SPI driver used.
27402  <p><b>Implementation:</b> Static</p>
27403  Description:
27404  This function returns the transmit buffer status (full/empty).
27405  Precondition:
27406  None.
27407  Parameters:
27408  None.
27409  Returns:
27410  Transmit Buffer Status
27411  - 1 - Full
27412  - 0 - Empty
27413  Example:
27414  <code>
27415  bool txBufStat;
27416  // Using instance 1 of SPI driver, that is n = 1
27417  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27418  if (txBufStat)
27419  {
27420  ...
27421  }
27422  </code>
27423  Remarks:
27424  None.
27425 */
27426 
27427 bool
27429 //DOM-IGNORE-BEGIN
27430 //DOM-IGNORE-END
27431  // #ifndef _DRV_SPI_H
27432 /*******************************************************************************
27433  End of File
27434 */
27435 
27436 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27437 /* CLOSE_FILE Include File */
27438 
27439 #include "driver/usb/usbhs/drv_usbhs.h"
27440 #include "usb/usb_device.h"
27441 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27442 /**************************************************************************************/
27443 /* LDRA_INSPECTED 110 S
27444 */
27460 /**************************************************************************************/
27461 #ifndef APP_H /* Guard against multiple inclusion.*/
27462 #define APP_H
27463 /**************************************************************************************/
27464 /* ************************************************************************************/
27465 /* Section: Included Files */
27466 /**************************************************************************************/
27467 /**************************************************************************************/
27468 #include <stdint.h>
27469 /**************************************************************************************/
27470 /**************************************************************************************/
27471 /* Section: Data Types */
27472 /**************************************************************************************/
27473 /**************************************************************************************/
27474 /**************************************************************************************/
27475 /* APP_DATA
27476  Summary:
27477  Holds APP_DATA used for the APP tasks.
27478  Description:
27479  Holds APP_DATA used for the APP tasks. The variables
27480  used are stored here.
27481  Remarks:
27482  None
27483  */
27484 
27485 typedef
27486  struct
27487  {
27488  uint8_t RevNumber ;
27489  } APP_DATA ;
27490 
27491 extern APP_DATA
27492  APP ;
27493 /**************************************************************************************/
27494 /**************************************************************************************/
27495 /* Section: Application Initialization and State Machine Functions */
27496 /**************************************************************************************/
27497 /**************************************************************************************/
27498 /*!*************************************************************************************
27499  Function:
27500  void APP_Initialize(void)
27501  Summary:
27502  Autonomous tool application initialization routine.
27503  Description:
27504  This function initializes the application. It places the
27505  application in its initial state and prepares it to run so that its
27506  APP_Tasks function can be called.
27507  Precondition:
27508  All other system initialization routines should be called before calling
27509  this routine (in "SYS_Initialize").
27510  Parameters:
27511  None.
27512  Returns:
27513  None.
27514  Example:
27515  APP_Initialize()
27516  Remarks:
27517  This routine must be called from the main function.
27518 */
27519 
27520 void
27521  APP_Initialize ( void ) ;
27522 /*!*************************************************************************************
27523  Function:
27524  void APP_Tasks(void)
27525  Summary:
27526  Application tasks function
27527  Description:
27528  This function is the main application's tasks function. It contains the various
27529  tasks that are maintained during the operation of the shooting panel.
27530  Precondition:
27531  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27532  should be called before calling this.
27533  Parameters:
27534  None.
27535  Returns:
27536  None.
27537  Example:
27538  APP_Tasks()
27539  Remarks:
27540  This routine must be called from the main() routine.
27541  */
27542 
27543 void
27544  APP_Tasks ( void ) ;
27545  /* APP_H */
27546 /***************************************************************************************
27547  End of File
27548  */
27549 
27550 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27551 /* CLOSE_FILE Include File */
27552 
27553 // DOM-IGNORE-BEGIN
27554 // DOM-IGNORE-END
27555 // *****************************************************************************
27556 // *****************************************************************************
27557 // Section: Type Definitions
27558 // *****************************************************************************
27559 // *****************************************************************************
27560 // *****************************************************************************
27561 /* System Objects
27562  Summary:
27563  Structure holding the system's object handles
27564  Description:
27565  This structure contains the object handles for all objects in the
27566  MPLAB Harmony project's system configuration.
27567  Remarks:
27568  These handles are returned from the "Initialize" functions for each module
27569  and must be passed into the "Tasks" function for each module.
27570 */
27571 
27572 typedef
27573  struct
27574  {
27575  SYS_MODULE_OBJ sysTmr ;
27576  SYS_MODULE_OBJ drvTmr0 ;
27577  SYS_MODULE_OBJ drvTmr1 ;
27578  SYS_MODULE_OBJ drvTmr2 ;
27579  SYS_MODULE_OBJ drvTmr3 ;
27580  SYS_MODULE_OBJ drvTmr4 ;
27581  SYS_MODULE_OBJ drvUsart0 ;
27582  SYS_MODULE_OBJ drvPMP0 ;
27583  /*** SPI Object for Index 0 ***/
27584  SYS_MODULE_OBJ spiObjectIdx0 ;
27585  /*** SPI Object for Index 1 ***/
27586  SYS_MODULE_OBJ spiObjectIdx1 ;
27587  /*** SPI Object for Index 2 ***/
27588  SYS_MODULE_OBJ spiObjectIdx2 ;
27589  SYS_MODULE_OBJ drvUSBObject ;
27590  SYS_MODULE_OBJ usbDevObject0 ;
27591  } SYSTEM_OBJECTS ;
27592 // *****************************************************************************
27593 // *****************************************************************************
27594 // Section: extern declarations
27595 // *****************************************************************************
27596 // *****************************************************************************
27597 
27598 extern SYSTEM_OBJECTS
27599  sysObj ;
27600 //DOM-IGNORE-BEGIN
27601 //DOM-IGNORE-END
27602  /* _SYS_DEFINITIONS_H */
27603 /*******************************************************************************
27604  End of File
27605 */
27606 
27607 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27608 /* CLOSE_FILE Include File */
27609 
27610 /**************************************************************************************/
27611 /**************************************************************************************/
27612 /* Section: Defines */
27613 /**************************************************************************************/
27614 /**************************************************************************************/
27615 /* Define the upper and lower bounds for Manchester data, TMR4 tick = 200nsec * 8 = 1.6usec */
27616 /* Define the upper and lower bounds for Manchester data, TMR2 tick = 10nS * 16 = 160nS. */
27617 //#define ManHalfUpper 1171 /* 1.8736 mS.*/
27618 //#define ManHalfLower 500 /* 0.8 mS.*/
27619 //#define ManFullUpper 1953 /* 3.12148 mS.*/
27620 //#define ManFullLower 1172 /* 1.8752 mS.*/
27621 //#define ManHalfUpper 6400 /* 1.8736 mS.?*/ /* time div = 32*/
27622 //#define ManHalfLower 1000 /* 0.8 mS.?*/
27623 //#define ManFullUpper 10000 /* 3.12148 mS.?*/
27624 //#define ManFullLower 6401 /* 1.8752 mS.?*/
27625 #define ManHalfUpper 11800U
27626 #define ManHalfLower 2000U
27627 #define ManFullUpper 20000U
27628 #define ManFullLower 11801U
27629 #define NoManBits 32U
27630 #define HalfBit 0x12U
27631 #define FullBit 0x10U
27632 #define SizeOfBiasLUT 48U
27633 /**************************************************************************************/
27634 /**************************************************************************************/
27635 /* Section: Data Types */
27636 /**************************************************************************************/
27637 /**************************************************************************************/
27638 
27639 typedef
27640 float
27642 /**************************************************************************************/
27643 /* MAN states
27644  Summary:
27645  MAN states enumeration
27646  Description:
27647  This enumeration defines the valid MAN states. These states determine the
27648  behavior of the MAN state machine at various times. This machine controls when
27649  the MAN_RX and MAN_PROCESS machines execute their states.
27650 */
27651 
27652 typedef
27653  enum
27654  {
27661  } MAN_STATES ;
27662 /**************************************************************************************/
27663 /* MAN_RX_STATES
27664  Summary:
27665  MAN_RX_STATES enumeration
27666  Description:
27667  This enumeration defines the valid MAN_RX_STATES. These states determine the
27668  behavior of the MAN_RX_STATES machine at various times. This machine receives
27669  the data from a PerfSwtich.
27670 */
27671 
27672 typedef
27673  enum
27674  {
27678  } MAN_RX_STATES ;
27679 /**************************************************************************************/
27680 /* MAN_PROCESS_STATES
27681  Summary:
27682  MAN_PROCESS_STATES enumeration
27683  Description:
27684  This enumeration defines the valid MAN_PROCESS_STATES. These states
27685  determine the behavior of the MAN_PROCESS_STATES machine at various times.
27686 */
27687 
27688 typedef
27689  enum
27690  {
27694  } MAN_PROCESS_STATES ;
27695 /**************************************************************************************/
27696 /* MAN_DATA
27697  Summary:
27698  Holds MAN_DATA used for the Manchester tasks.
27699  Description:
27700  Holds MAN_DATA used for the Manchester tasks. The state machines and variables
27701  used to control Manchester functions are stored here.
27702  Remarks:
27703  None
27704  */
27705 
27706 typedef
27707  struct
27708  {
27709  MAN_STATES state ;
27710  MAN_RX_STATES Rx_state ;
27711  MAN_PROCESS_STATES Process_state ;
27712  uint16_t preamble [ 5 ] ;
27713  uint16_t time [ 96 ] ;
27714  uint8_t level [ 96 ] ;
27715  uint8_t ans [ 32U + 2 ] ;
27716  uint8_t msg [ 4 ] ;
27717  uint8_t cnt_preamble ;
27718  uint8_t trynumber ;
27719  bool process_complete_flag ;
27720  bool spi_write_complete_flag ;
27721  bool spi_sent_flag ;
27722  uint8_t timer_count ;
27723  uint8_t timer_complete ;
27724  bool tick ;
27725  bool bad_crc ;
27726  bool error ;
27727  bool manual_bias_flag ;
27728  uint8_t crc ;
27729  } MAN_DATA ;
27730 
27731 extern MAN_DATA
27732  MAN ;
27733 /**************************************************************************************/
27734 /* MAN_BIAS_DATA
27735  Summary:
27736  Holds MAN_BIAS_DATA
27737  Description:
27738  This structure holds the MAN_BIAS_DATA. It is used to adjust the bias value of
27739  the Manchester DAC.
27740  Remarks:
27741  None
27742  */
27743 
27744 typedef
27745  struct
27746  {
27747  DRV_HANDLE spi_bias_fsk ;
27748  DRV_SPI_BUFFER_HANDLE bufferHandle ;
27749  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
27750  uint16_t adj [ 1 ] ;
27751  uint16_t dac_a_setting ;
27752  uint16_t dac_b_setting ;
27753  float32_t hi_current ;
27754  float32_t lo_current ;
27755  float32_t lo_volts ;
27756  float32_t hi_volts ;
27757  float32_t slope ;
27758  float32_t offset ;
27759  uint8_t index ;
27760  } MAN_BIAS_DATA ;
27761 
27762 extern MAN_BIAS_DATA
27763  MAN_BIAS ;
27764 /**************************************************************************************/
27765 /**************************************************************************************/
27766 /* Local Functions */
27767 /**************************************************************************************/
27768 /**************************************************************************************/
27769 /*!*************************************************************************************
27770  Function:
27771  static void Init_Manchester( void )
27772  Summary:
27773  Function to initialize the Manchester parameters.
27774  Description:
27775  Function to initialize the Manchester parameters.
27776 
27777  Precondition:
27778  None.
27779  Parameters:
27780  None.
27781  Returns:
27782  None.
27783 
27784  Remarks:
27785  None.
27786 
27787  Example:
27788  Init_Manchester()
27789  */
27790 
27791 static void
27792  Init_Manchester ( void ) ;
27793 /*!*************************************************************************************
27794  Function:
27795  static bool Check_Manchester( void )
27796  Summary:
27797  This routine checks for valid Manchester response.
27798  Description:
27799  This routine checks for valid Manchester response. The first two bytes are
27800  checked. If both are zero, then we did not receive a valid response. This is
27801  used in the function Test_Manchester.
27802 
27803  Precondition:
27804  None.
27805  Parameters:
27806  None.
27807  Returns:
27808  bool ans
27809 
27810  Remarks:
27811  None.
27812 
27813  Example:
27814  if( Check_Manchester( ) == true )
27815  */
27816 
27817 static bool
27818  Check_Manchester ( void ) ;
27819 /*!*************************************************************************************
27820  Function:
27821  static void Decode_Manchester( void )
27822  Summary:
27823  Function to decode the Manchester response from a PerfSwitch.
27824  Description:
27825  Function to decode the Manchester response from a PerfSwitch. The MAN.level
27826  and MAN.time arrays are used to generate the MAN.ANS array.
27827  MAN.level[] - level of the incoming data.
27828  MAN.time[] - time of corresponding wave timer ticks.
27829 
27830  The last 1 of the preamble is always in the data so we have a fixed starting point.
27831 
27832  Precondition:
27833  None.
27834  Parameters:
27835  None.
27836  Returns:
27837  None.
27838 
27839  Remarks:
27840  None.
27841 
27842  Example:
27843  Decode_Manchester()
27844  */
27845 
27846 static void
27847  Decode_Manchester ( void ) ;
27848 /*!*************************************************************************************
27849  Function:
27850  static void Package_Manchester( void )
27851  Summary:
27852  Function to prepare Manchester response for further processing.
27853  Description:
27854  Function to prepare Manchester response for further processing. The Manchester
27855  response is decoded and the 1 X 32 answer array is packed into a 4 X 8 bit
27856  message array.
27857 
27858  Precondition:
27859  None.
27860  Parameters:
27861  None.
27862  Returns:
27863  None.
27864 
27865  Remarks:
27866  None.
27867 
27868  Example:
27869  Package_Manchester()
27870  */
27871 
27872 static void
27873  Package_Manchester ( void ) ;
27874 /*!*************************************************************************************
27875  Function:
27876  static void Test_Manchester (void)
27877  Summary:
27878  Function to test the returned Manchester message.
27879  Description:
27880  Function to test the returned Manchester message. The first two bytes are checked
27881  to make sure they are not both 0. If they are not, the FSK frequencies are
27882  adjusted, and the CRC is checked. If the CRC is a match, then a response message
27883  to the host is prepared. Otherwise, up to two different FSK frequencies are
27884  tried in order to establish communications with a PerfSwitch.
27885 
27886  Precondition:
27887  None.
27888  Parameters:
27889  None.
27890  Returns:
27891  None.
27892 
27893  Remarks:
27894  None.
27895 
27896  Example:
27897  Test_Manchester ()
27898  */
27899 
27900 static void
27901  Test_Manchester ( void ) ;
27902 /*!*************************************************************************************
27903  Function:
27904  static void Flush_Buffer_Manchester( void )
27905  Summary:
27906  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
27907  Description:
27908  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
27909  These are flushed after every reception.
27910 
27911  Precondition:
27912  None.
27913  Parameters:
27914  None.
27915  Returns:
27916  None.
27917 
27918  Remarks:
27919  None.
27920 
27921  Example:
27922  Flush_Buffer_Manchester()
27923  */
27924 
27925 static void
27926  Flush_Buffer_Manchester ( void ) ;
27927 /*!*************************************************************************************
27928  Function:
27929  static float32_t Calc_Fsk_Scaling( void )
27930  Summary:
27931  Function to calculate the amount of FSK adjustment needed based on the preamble bit
27932  timer counts.
27933  Description:
27934  Function to calculate the amount of FSK adjustment needed based on the preamble bit
27935  timer counts. The average of the timer counts is used to determine the amount
27936  of adjustment. The result is a multiplier used in the Generate_Sine_Wave _Data
27937  function to change the amount of time between the FSK DAC updates. Adjustments
27938  up to 10% have been seen in temperature testing. Adjustments are generally
27939  greater than 1 when a PerfSwitch is hot and less than 1 when a PerfSwitch is cold.
27940 
27941  Precondition:
27942  None.
27943  Parameters:
27944  None.
27945  Returns:
27946  None.
27947 
27948  Remarks:
27949  None.
27950 
27951  Example:
27952  CalcFskScaling( )
27953  */
27954 
27955 static float32_t
27956  Calc_Fsk_Scaling ( void ) ;
27957 /**************************************************************************************/
27958 /**************************************************************************************/
27959 /* Interface Functions */
27960 /**************************************************************************************/
27961 /**************************************************************************************/
27962 /*!*************************************************************************************
27963  Function:
27964  void Calc_Auto_Bias(void)
27965  Summary:
27966  Function to calculate the amount of bias adjust required and to transmit that
27967  result via a SPI port to the Manchester bias DAC.
27968  Description:
27969  Function to calculate the amount of bias adjust required and to transmit that
27970  result via a SPI port to the Manchester bias DAC.
27971 
27972  Precondition:
27973  None.
27974  Parameters:
27975  None.
27976  Returns:
27977  None.
27978 
27979  Remarks:
27980  None.
27981 
27982  Example:
27983  CalcAutoBias()
27984  */
27985 
27986 void
27987  Calc_Auto_Bias ( void ) ;
27988 /*!*************************************************************************************
27989  Function:
27990  void Set_Bias(uint8_t value)
27991  Summary:
27992  Function to transmit the bias adjust value via an SPI port to the Manchester
27993  bias DAC.
27994  Description:
27995  Function to transmit the bias adjust value via an SPI port to the Manchester
27996  bias DAC. Value is integer between 0 and 47. Values greater than 47 are set to 47.
27997 
27998  Precondition:
27999  None.
28000  Parameters:
28001  uint8_t value
28002  Returns:
28003  None.
28004 
28005  Remarks:
28006  None.
28007 
28008  Example:
28009  Set_Bias(uint8_t value)
28010  */
28011 
28012 void
28013  Set_Bias (
28014  uint8_t value ) ;
28015 /**************************************************************************************/
28016 /**************************************************************************************/
28017 /* State Machine Functions */
28018 /**************************************************************************************/
28019 /**************************************************************************************/
28020 /*!*************************************************************************************
28021  Function:
28022  void MAN_Tasks(void)
28023  Summary:
28024  MAN tasks function
28025  Description:
28026  This routine is the MAN tasks function. It defines the MAN's state machine and
28027  core logic. This machine controls the MAN operation and sets flags indicating
28028  new values are available from the system interrupt routine for use in other parts
28029  of the application. It also controls when the MAN_Process_Tasks machine and
28030  MAN_RX_Tasks machines operate.
28031  Precondition:
28032  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28033  should be called before calling this.
28034  Parameters:
28035  None.
28036  Returns:
28037  None.
28038  Example:
28039  MAN_Tasks()
28040 
28041  Remarks:
28042  This routine must be called from the APP_Tasks() routine.
28043  */
28044 
28045 void
28046  MAN_Tasks ( void ) ;
28047 /*!*************************************************************************************
28048  Function:
28049  static void MAN_PROCESS_Tasks(void)
28050  Summary:
28051  MAN_PROCESS tasks function
28052  Description:
28053  This routine is the MAN_PROCESS tasks function. It defines the MAN_PROCESS's
28054  state machine and core logic. This machine controls the MAN_Process operation. It
28055  decodes, packages, tests and prepares for another message to process.
28056 
28057  During packaging, the 32 bit Manchester response is packaged into a 4 byte array.
28058 
28059  During testing, the CRC is checked and the appropriate response is prepared to
28060  send to the host. If a bad response was received, the FSK frequencies are adjusted
28061  and two more attempts are made to retrieve a valid response.
28062 
28063  Precondition:
28064  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28065  should be called before calling this.
28066  Parameters:
28067  None.
28068  Returns:
28069  None.
28070  Example:
28071  MAN_PROCESS_Tasks()
28072 
28073  Remarks:
28074  This routine must be called from the MAN_Tasks() routine.
28075  */
28076 
28077 static void
28078  MAN_PROCESS_Tasks ( void ) ;
28079 /*!*************************************************************************************
28080  Function:
28081  void MAN_RX_Tasks(void)
28082  Summary:
28083  MAN_Rx tasks function
28084  Description:
28085  This routine is the MAN_Rx tasks function. It defines the MAN_Rx's
28086  state machine and core logic. It determines if a proper message preamble has
28087  been received and determines the time and input level state when a transition
28088  occurs. This routine is called when there is a high to low change on the port pin.
28089 
28090  The state MAN_RX_STATE_IDLE has no effect on Manchester processing.
28091  The state MAN_RX_STATE_PREAMBLE is responsible for syncing up to a 1111.
28092  The state MAN_RX_STATE_DATA receives the data. The time ranges allow for variances
28093  between PerfSwitches and how they perform over temperature.
28094 
28095  Precondition:
28096  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28097  should be called before calling this.
28098  Parameters:
28099  None.
28100  Returns:
28101  None.
28102  Example:
28103  MAN_RX_Tasks()
28104 
28105  Remarks:
28106  This routine must be called from the MAN_Tasks() routine.
28107  */
28108 
28109 void
28110  MAN_RX_Tasks ( void ) ;
28111  /* MAN_H */
28112 /***************************************************************************************
28113  End of File
28114  */
28115 
28116 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h*/
28117 /* CLOSE_FILE Include File */
28118 
28119 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\crc.h */
28120 /**************************************************************************************/
28134 /**************************************************************************************/
28135 #ifndef CRC_H /* Guard against multiple inclusion.*/
28136 #define CRC_H
28137 /**************************************************************************************/
28138 /* ************************************************************************************/
28139 /* Section: Included Files */
28140 /**************************************************************************************/
28141 /**************************************************************************************/
28142 #include <stdint.h>
28143 
28144 typedef
28145 unsigned char
28147 /**************************************************************************************/
28148 /**************************************************************************************/
28149 /* Interface Functions */
28150 /**************************************************************************************/
28151 /**************************************************************************************/
28152 /*!*************************************************************************************
28153  Function:
28154  void Calc_CRC(uint16_t nbits, uint8_t thebits)
28155  Summary:
28156  Function to calculate the CRC for a number of data bits.
28157  Description:
28158  Function to calculate the CRC for a number of data bits. The algorithm for the
28159  CRC calculation was created by Tom Woods. CRCVal is usually reset to 0xFF prior
28160  to calling this function. This is not the case when calculating the CRC for an
28161  array.
28162 
28163  Precondition:
28164  None.
28165  Parameters:
28166  int16_t nbits - the number of data bits.
28167  uint8_t thebits - the data bits themselves.
28168  Returns
28169  None.
28170 
28171  Remarks
28172  None.
28173 
28174  Example:
28175  Calc_CRC( 8, Bytes[ 1 ] )
28176  */
28177 
28178 void
28179  Calc_CRC (
28180  uint16_t nbits ,
28181  uint8_t thebits ) ;
28182 /*!*************************************************************************************
28183  Function:
28184  uint8_t Calc_CRC_Array(uint16_t Count, const uint8_t Bytes[ ] )
28185  Summary:
28186  Function to calculate the CRC of an array of bytes. This function uses the function
28187  CalcCRC to complete this task.
28188  Description:
28189  Function to calculate the CRC of an array of bytes. This function uses the function
28190  CalcCRC to complete this task. It returns the eight bit CRCVal from the
28191  calculation.
28192 
28193  Precondition:
28194  None.
28195  Parameters:
28196  None.
28197  Returns
28198  uint8_t CRCVal
28199 
28200  Remarks
28201  None.
28202 
28203  Example:
28204  a_comm_crc = CalcCRCArray( 6, a_temp )
28205  */
28206 
28207 uint8_t
28208  Calc_CRC_Array (
28209  uint16_t Count ,
28210  const uint8_t Bytes [] ) ;
28211 /*!*************************************************************************************
28212  Function:
28213  uint8_t Calc_CRC_Uplink(int16_t Count, const uint8_t Bytes[ ] )
28214  Summary:
28215  Function to calculate the CRC from a received PerfSwitch message.
28216  Description:
28217  Function to calculate the CRC from a received PerfSwitch message. This function
28218  makes use of the function CalcCRC() to perform the calculation. The CRC result
28219  is compared to the third byte of the returned Manchester message.
28220 
28221 
28222 
28223  Precondition:
28224  None.
28225  Parameters:
28226  int16_t Count: Acts as a flag.
28227  unsigned char Bytes[ ]:
28228  Returns:
28229  uint8_t CRCVal
28230 
28231  Remarks:
28232  None.
28233 
28234  Example:
28235  crcans1 = Calc_CRC_Uplink( 3, MAN.MSG )
28236  */
28237 
28238 uint8_t
28239  Calc_CRC_Uplink (
28240  uint16_t Count ,
28241  const uint8_t Bytes [] ) ;
28242 /*!*************************************************************************************
28243  Function:
28244  void Reset_CRC_Value( void )
28245  Summary:
28246  This function resets the CRC value so a new calculation can take place.
28247  Description:
28248  This function resets the CRC value so a new calculation can take place. It
28249  resets the value to 0xFF. This allows for the proper bit manipulation during
28250  the CRC calculation.
28251 
28252  Precondition:
28253  None.
28254  Parameters:
28255  None.
28256  Returns
28257  None.
28258 
28259  Remarks
28260  None.
28261 
28262  Example:
28263  Reset_CRC_Value()
28264  */
28265 
28266 void
28267  Reset_CRC_Value ( void ) ;
28268 /*!*************************************************************************************
28269  Function:
28270  uint8_t GetCRCValue( void ))
28271  Summary:
28272  Function to return a previously calculated CRC value.
28273  Description:
28274  Function to return a previously calculated CRC value. No calculations are done
28275  here.
28276 
28277  Precondition:
28278  None.
28279  Parameters:
28280  None.
28281  Returns
28282  uint8_t CRCVal
28283 
28284  Remarks
28285  None.
28286 
28287  Example:
28288  FSK.crc = Get_CRC_Value( )
28289  */
28290 
28291 uint8_t
28292  Get_CRC_Value ( void ) ;
28293  /* CRC_H */
28294 /***************************************************************************************
28295  End of File
28296  */
28297 
28298 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\crc.h*/
28299 /* CLOSE_FILE Include File */
28300 
28301 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h */
28302 /**************************************************************************************/
28316 /**************************************************************************************/
28317 #ifndef FSK_H /* Guard against multiple inclusion */
28318 #define FSK_H
28319 /**************************************************************************************/
28320 /**************************************************************************************/
28321 /* Section: Included Files */
28322 /**************************************************************************************/
28323 /**************************************************************************************/
28324 #include "../system_config.h"
28325 #include "../system_definitions.h"
28326 /**************************************************************************************/
28327 /**************************************************************************************/
28328 /* Section: Data Types */
28329 /**************************************************************************************/
28330 /**************************************************************************************/
28331 
28332 typedef
28333 float
28334  float32_t ;
28335 /**************************************************************************************/
28336 /*FSK states
28337  Summary:
28338  FSK states enumeration
28339  Description:
28340  This enumeration defines the valid FSK states. These states
28341  determine the behavior of the FSK state machine at various times.
28342 */
28343 
28344 typedef
28345  enum
28346  {
28353  } FSK_STATES ;
28354 /**************************************************************************************/
28355 /* FSK_DATA
28356  Summary:
28357  Holds FSK_DATA used for the FSK tasks.
28358  Description:
28359  Holds FSK_DATA used for the FSK tasks. The state machine and variables
28360  used to control FSK functions are stored here.
28361  Remarks:
28362  None
28363  */
28364 
28365 typedef
28366  struct
28367  {
28368  FSK_STATES state ;
28369  uint8_t crc ;
28370  uint8_t null_count ;
28371  bool send_message_complete_flag ;
28372  bool tick ;
28373  float32_t baud ;
28374  float32_t fsk_timer_freq ;
28375  float32_t mark_count ;
28376  float32_t space_count ;
28377  float32_t TABLE_MOD [ 50 ] ;
28378  uint8_t table_count ;
28379  } FSK_DATA ;
28380 
28381 extern FSK_DATA
28382  FSK ;
28383  /**************************************************************************************/
28384 
28385 typedef
28386  union /* Union defining the PerfSwitch message component lengths.*/
28387  {
28388  uint32_t dword ;
28389  uint16_t word ;
28390  uint8_t byte [ 4 ] ;
28391  } TMultiValue ;
28392 
28393 extern TMultiValue
28394  MESSAGE ;
28395 /**************************************************************************************/
28396 /**************************************************************************************/
28397 /* DOWN_MSG Data
28398  Summary:
28399  Holds DOWN_MSG data used for the FSK tasks.
28400  Description:
28401  Holds DOWN_MSG data used for the FSK tasks. The variables used to control FSK
28402  message are stored here.
28403  Remarks:
28404  None
28405  */
28406 
28407 typedef
28408  struct /* Structure defining the components of the FSK message to a PerfSwitch.*/
28409  {
28410  uint8_t identifier ;
28411  uint8_t command ;
28412  uint8_t msg_length ;
28413  uint8_t xmit_ready_flag ;
28414  } DOWN_MSG ;
28415 
28416 extern DOWN_MSG
28417  DWNMSG ;
28418 /**************************************************************************************/
28419 /*MSG states
28420  Summary:
28421  MSG states enumeration
28422  Description:
28423  This enumeration defines the valid MSG states. These states
28424  determine the behavior of the MSG state machine at various times. This machine
28425  also controls access to the PRE_MSG state machine.
28426 */
28427 
28428 typedef
28429  enum
28430  {
28436  } MSG_STATES ;
28437 /**************************************************************************************/
28438 /* MSG_DATA
28439  Summary:
28440  Holds MSG_DATA used for the MSG tasks.
28441  Description:
28442  Holds MSG_DATA used for the MSG tasks. The state machine and variables
28443  used to control MSG functions are stored here.
28444  Remarks:
28445  None
28446  */
28447 
28448 typedef
28449  struct
28450  {
28451  MSG_STATES state ;
28452  uint32_t command ;
28453  uint8_t length ;
28454  } MSG_DATA ;
28455 
28456 extern MSG_DATA
28457  MSG ;
28458 /**************************************************************************************/
28459 /*PREAMBLE states
28460  Summary:
28461  PRE_MSG states enumeration
28462  Description:
28463  This enumeration defines the valid PREAMBLE states. These states
28464  determine the behavior of the PREAMBLE state machine at various times. This is
28465  accessed from the MSG_STATE machine.
28466 */
28467 
28468 typedef
28469  enum
28470  {
28477  } PREAMBLE_STATES ;
28478 /**************************************************************************************/
28479 /* PRE_DATA
28480  Summary:
28481  Holds PRE_MSG_DATA used for the PRE_MSG tasks.
28482  Description:
28483  Holds PRE_MSG_DATA used for the PRE_MSG tasks. The state machine and variables
28484  used to control PRE_MSG functions are stored here.
28485  Remarks:
28486  None
28487  */
28488 
28489 typedef
28490  struct
28491  {
28492  PREAMBLE_STATES state ;
28493  } PRE_DATA ;
28494 
28495 extern PRE_DATA
28496  PRE_MSG ;
28497 
28498 static const uint8_t
28499  Xmit11 [ 312 ] = /* Array for the FSK frequency generation for a 'Mark'.*/
28500  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
28501  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
28502  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
28503  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
28504  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
28505  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U
28506  , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U ,
28507  0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU
28508  , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU ,
28509  0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U
28510  , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
28511 
28512 static const uint8_t
28513  Xmit00 [ 168 ] = /* Array for the FSK frequency generation for a 'Space'.*/
28514  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
28515  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
28516  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
28517  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
28518  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
28519  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
28520 /**************************************************************************************/
28521 /**************************************************************************************/
28522 /* External Functions */
28523 /**************************************************************************************/
28524 /**************************************************************************************/
28525 /*!*************************************************************************************
28526  Function:
28527  void Prepare_Dwn_Msg( uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length )
28528  Summary:
28529  Receives information from the command parser and stores it into the DwnMsg (FSK)
28530  structure for transmission by FSK.
28531  Description:
28532  Receives information from the command parser and stores it into the DwnMsg (FSK)
28533  structure for transmission by FSK. No other action is performed on the data here.
28534  The DwnMsg (FSK) elements can be manipulated prior to the FSK transmission to
28535  create the final MESSAGE array for longer commands.
28536 
28537  Precondition:
28538  None.
28539  Parameters:
28540  uint8_t Identifier: The lower 3 bits of Frame 4 from the Protocol B command.
28541  uint8_t Cmd: Frame 0 from the Protocol B command.
28542  uint8_t msgLength: The FSK message length in bits.
28543  Returns
28544  None.
28545 
28546  Remarks
28547  None.
28548 
28549  Example:
28550  Prepare_Dwn_Msg(ident,cmd, 20)
28551  */
28552 
28553 void
28554  Prepare_Dwn_Msg (
28555  uint8_t Identifier ,
28556  uint8_t Cmd ,
28557  uint8_t Msg_Length ) ;
28558 /*!*************************************************************************************
28559  Function:
28560  void Generate_Sine_Wave_Data( float32_t NoOfTicks )
28561  Summary:
28562  This function stores sine wave inter step time values into two arrays at
28563  initialization and if the FSK frequency needs to be adjusted. These values
28564  represent the amount of time between updates of the sine wave data DAC used to
28565  generate a 1 or 0.
28566  Description:
28567  This function stores sine wave inter step time values into two arrays at
28568  initialization and if the FSK frequency needs to be adjusted. The TimeMark array
28569  is for the time between a 'MARK' update and the TimeSpace array is for the time
28570  between a 'SPACE' update. Changing the time between the updates will effectively
28571  change the transmitted frequency for a 'MARK' or 'SPACE'. This occurs if there
28572  are errors during the data transmission to a PerfSwitch. This can occur as the
28573  PerfSwitch gets hot when it is down hole.
28574 
28575  Precondition:
28576  None.
28577  Parameters:
28578  float32_t NoOfTicks: This is an error factor used to correct the inter step
28579  time values.
28580  Returns
28581  None.
28582 
28583  Remarks
28584  None.
28585 
28586  Example:
28587  void GenerateSineWaveData( float32_t NoOfTicks )
28588  */
28589 
28590 void
28592  float32_t NoOfTicks ) ;
28593 /**************************************************************************************/
28594 /**************************************************************************************/
28595 /* Local Functions */
28596 /**************************************************************************************/
28597 /**************************************************************************************/
28598 /*!*************************************************************************************
28599  Function:
28600  static void Init_FSK( void )
28601  Summary:
28602  Function to initialize the FSK parameters.
28603  Description:
28604  Function to initialize the FSK parameters. All of the flags and table data are
28605  set to their initial condition. Timer 2 is also started. It is set to 160nS and
28606  is used to count the time between the Manchester transitions.
28607 
28608  Precondition:
28609  None.
28610  Parameters:
28611  None.
28612  Returns:
28613  None.
28614 
28615  Remarks:
28616  None.
28617 
28618  Example:
28619  Init_FSK()
28620  */
28621 
28622 static void
28623  Init_FSK ( void ) ;
28624 /*!*************************************************************************************
28625  Function:
28626  static void Send_Space( void )
28627  Summary:
28628  This function sends a FSK 0 or 'SPACE'.
28629  Description:
28630  This function sends a FSK 0 or 'SPACE'. It is called from the SendMessage
28631  function. sendSpace reads the Xmit00 array and sends the data to the FSK DAC.
28632  The time between the updates is controlled by a timer matching the corresponding
28633  value of the TimeSpace array. An FSK 'zero' is approximately 2800 Hz with
28634  7 cycles lasting approximately 2.5 ms.
28635 
28636  Precondition:
28637  None.
28638  Parameters:
28639  None.
28640  Returns
28641  None.
28642 
28643  Remarks
28644  None.
28645 
28646  Example:
28647  SendSpace()
28648  */
28649 
28650 static void
28651  Send_Space ( void ) ;
28652 /*!*************************************************************************************
28653  Function:
28654  static void Send_Mark( void )
28655  Summary:
28656  This function sends a FSK 1 or 'MARK'.
28657  Description:
28658  This function sends a FSK 1 or 'MARK'. It is called from the Send_Message_Task
28659  function. Send_Mark reads the Xmit11 array and sends the data to the FSK DAC.
28660  The time between the updates is controlled by a timer matching the corresponding
28661  value of the TimeMark array. An FSK 'one' is approximately 5200 Hz with
28662  13 cycles lasting approximately 2.5 ms.
28663 
28664  Precondition:
28665  None.
28666  Parameters:
28667  None.
28668  Returns
28669  None.
28670 
28671  Remarks
28672  None.
28673 
28674  Example:
28675  sendMark()
28676  */
28677 
28678 static void
28679  Send_Mark ( void ) ;
28680 /**************************************************************************************/
28681 /**************************************************************************************/
28682 /* State Machine Functions */
28683 /**************************************************************************************/
28684 /**************************************************************************************/
28685 /*!*************************************************************************************
28686  Function:
28687  void FSK_Tasks(void)
28688  Summary:
28689  FSK_Tasks function
28690  Description:
28691  This routine is the FSK_Tasks function. It defines the FSK_Tasks state
28692  machine and core logic. This machine is used to send an FSK message to a
28693  PerfSwitch. It checks to see if there is a message for Tx and decides if it is a
28694  short or a long message. For a long message, it calculates the CRC and appends
28695  it to the Message and calls Send_Message_Tasks. If a good Manchester response is
28696  received, it resets all flags and prepares to send another message. Otherwise,
28697  it prepares to resend the previous message at a corrected frequency.
28698 
28699  Precondition:
28700  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28701  should be called before calling this.
28702  Parameters:
28703  None.
28704  Returns:
28705  None.
28706  Remarks:
28707  This routine must be called from the APP_Tasks() routine.
28708  Example:
28709  FSK_Tasks()
28710  */
28711 
28712 void
28713  FSK_Tasks ( void ) ;
28714 /*!*************************************************************************************
28715  Function:
28716  static void Send_Message_Tasks(void)
28717  Summary:
28718  Send_Message_Tasks function
28719  Description:
28720  This routine is the Send_Message_Tasks function. It defines the Send_Message_Tasks
28721  state machine and core logic. This machine is used to send an FSK message to a
28722  PerfSwitch. It can control the MAnchester bias DAC. It then controls the PREAMBLE
28723  (PRE_MSG) state machine to send the preamble. Then the actual message is sent.
28724  Precondition:
28725  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28726  should be called before calling this.
28727  Parameters:
28728  None.
28729  Returns:
28730  None.
28731  Remarks:
28732  This routine must be called from the FSK_Tasks() routine.
28733  Example:
28734  Send_Message_Tasks()
28735  */
28736 
28737 static void
28738  Send_Message_Tasks ( void ) ;
28739  /* FSK_H */
28740 /***************************************************************************************
28741  End of File
28742  */
28743 
28744 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h*/
28745 /* CLOSE_FILE Include File */
28746 
28747 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h */
28748 /**************************************************************************************/
28763 /**************************************************************************************/
28764 #ifndef WL_CPS_H /* Guard against multiple inclusion */
28765 #define WL_CPS_H
28766 /**************************************************************************************/
28767 /* ************************************************************************************/
28768 /* Section: Included Files */
28769 /**************************************************************************************/
28770 /**************************************************************************************/
28771 #include "../system_definitions.h"
28772 
28773 typedef
28774 float
28775  float32_t ;
28776 /**************************************************************************************/
28777 /**************************************************************************************/
28778 /* Section: Data Types */
28779 /**************************************************************************************/
28780 /**************************************************************************************/
28781 
28782 typedef
28783  enum
28784  {
28791  } WL_CPS_STATES ;
28792 
28793 typedef
28794  struct
28795  {
28796  WL_CPS_STATES state ;
28797  DRV_HANDLE spi_cont_pot ;
28798  DRV_SPI_BUFFER_HANDLE bufferHandle ;
28799  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
28800  int8_t v_adj [ 1 ] ;
28801  uint16_t voltage ;
28802  uint16_t voltage_limit ;
28803  uint16_t current ;
28804  uint16_t max_current ;
28805  uint8_t current_limit ;
28806  uint8_t upper_current_limit ;
28807  uint8_t over_current_count ;
28808  float32_t volt_constant ;
28809  float32_t current_constant ;
28810  bool new_voltage_flag ;
28811  bool new_current_flag ;
28812  bool spi_write_complete_flag ;
28813  bool spi_sent_flag ;
28814  uint8_t avg_count ;
28815  uint8_t avg_count_max ;
28816  uint16_t current_array [ 5 ] ;
28817  uint16_t avg_current ;
28818  uint8_t overvoltage_count ;
28819  } WL_CPS_DATA ;
28820 
28821 extern WL_CPS_DATA
28822  WL_CPS ;
28823 /**************************************************************************************/
28824 /**************************************************************************************/
28825 /* Section: Local Functions */
28826 /**************************************************************************************/
28827 /**************************************************************************************/
28828 /*!*************************************************************************************
28829  Function:
28830  static void Init_WL_CPS( void )
28831  Summary:
28832  This function initializes the wire-line communication power supply parameters.
28833  Description:
28834  This function initializes the wire-line communication power supply parameters.
28835  Initial limits, flags and constants are set here.
28836 
28837  Precondition:
28838  None.
28839  Parameters:
28840  None.
28841  Returns
28842  None.
28843 
28844  Remarks
28845  None.
28846 
28847  Example:
28848  Init_WL_CPS()
28849  */
28850 
28851 static void
28852  Init_WL_CPS ( void ) ;
28853 /*!*************************************************************************************
28854  Function:
28855  static void Read_WL_CPS_V_I( void )
28856  Summary:
28857  This task reads the voltage and current from the wire line communication power
28858  supply(WL_CPS). It also tracks the maximum current from the supply.
28859  Description:
28860  This task reads the voltage and current from the wire line communication power
28861  supply(WL_CPS). It also tracks the maximum current from the supply.
28862 
28863  Precondition:
28864  None.
28865  Parameters:
28866  None.
28867  Returns
28868  None.
28869 
28870  Remarks
28871  None.
28872 
28873  Example:
28874  Read_WL_CPS_V_I( )
28875  */
28876 
28877 static void
28878  Read_WL_CPS_V_I ( void ) ;
28879 /*!*************************************************************************************
28880  Function:
28881  static void Check_WL_CPS_Over_Current( void )
28882  Summary:
28883  This function checks if the WL_CPS current has exceeded the current limit.
28884  Description:
28885  This function checks if the WL_CPS current has exceeded the current limit. If
28886  the current has exceeded the limit for five readings, the supply is turned off.
28887 
28888  Precondition:
28889  None.
28890  Parameters:
28891  None.
28892  Returns
28893  None.
28894 
28895  Remarks
28896  None.
28897 
28898  Example:
28899  Check_WL_CPS_Over_Current( )
28900  */
28901 
28902 static void
28903  Check_WL_CPS_Over_Current ( void ) ;
28904 /*!*************************************************************************************
28905  Function:
28906  void Set_WL_CPS_CurrentLimit(uint8_t value)
28907  Summary:
28908  This function sets the WL_CPS current limit.
28909  Description:
28910  This function sets the WL_CPS current limit. It must be less than or equal to
28911  the upper current limit. This parameter is used in the over current check.
28912 
28913  Precondition:
28914  None.
28915  Parameters:
28916  uint8_t value - the current limit in mA.
28917  Returns
28918  None.
28919 
28920  Remarks
28921  None.
28922 
28923  Example:
28924  Set_WL_CPS_CurrentLimit(70)
28925  */
28926 
28927 void
28929  uint8_t value ) ;
28930 /*!*************************************************************************************
28931  Function:
28932  void Adjust_WL_CPS_Voltage(uint8_t target)
28933  Summary:
28934  This function adjusts the WL_CPS to the desired voltage.
28935  Description:
28936  This function adjusts the WL_CPS to the desired voltage. The value is checked
28937  to ensure it is within the adjustable limits of 15 to 64 VDC. That voltage is
28938  converted to a table value that contains the appropriate pot settings for a
28939  given voltage. The pot settings is then transmitted via SPI port to the
28940  WL_CPS control pot.
28941 
28942  Precondition:
28943  None.
28944  Parameters:
28945  uint8_t target - desired voltage between 15 and 64V.
28946  Returns
28947  None.
28948 
28949  Remarks
28950  None.
28951 
28952  Example:
28953  Adjust_WL_CPS_Voltage(30)
28954  */
28955 
28956 void
28958  uint8_t target ) ;
28959 /**************************************************************************************/
28960 /**************************************************************************************/
28961 /* State Machine Functions */
28962 /**************************************************************************************/
28963 /**************************************************************************************/
28964 /*!*************************************************************************************
28965  Function:
28966  *
28967  void WL_CPS_Tasks(void)
28968  Summary:
28969  WL_CPS_Tasks function
28970  Description:
28971  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28972  machine and core logic. This machine is used to monitor the wire-line communication
28973  power supply (WL_CPS) voltage and current and will set flags when those limits
28974  are exceeded.
28975  Precondition:
28976  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28977  should be called before calling this.
28978  Parameters:
28979  None.
28980  Returns:
28981  None.
28982  Remarks:
28983  This routine must be called from the APP_Tasks() routine.
28984  Example:
28985  WL_CPS_Tasks()
28986  */
28987 
28988 void
28989  WL_CPS_Tasks ( void ) ;
28990  /* WL_CPS_H */
28991 /***************************************************************************************
28992  End of File
28993  */
28994 
28995 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h*/
28996 /* CLOSE_FILE Include File */
28997 
28998 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\timers.h */
28999 /**************************************************************************************/
29014 /**************************************************************************************/
29015 #ifndef TIMERS_H /* Guard against multiple inclusion.*/
29016 #define TIMERS_H
29017 /**************************************************************************************/
29018 /**************************************************************************************/
29019 /* Section: Included Files */
29020 /**************************************************************************************/
29021 /**************************************************************************************/
29022 #include <stdint.h>
29023 #include <stdbool.h> /* Defines true.*/
29024 #include "../system_config.h"
29025 #include "../system_definitions.h"
29026 /**************************************************************************************/
29027 /**************************************************************************************/
29028 /* Section: Data Types */
29029 /**************************************************************************************/
29030 /**************************************************************************************/
29031 /**************************************************************************************/
29032 /* TIMER states
29033  Summary:
29034  TIMER states enumeration
29035  Description:
29036  This enumeration defines the valid TIMER states. These states
29037  determine the behavior of the TIMER state machine at various times.
29038 */
29039 
29040 typedef
29041  enum
29042  {
29046  } TIMER_STATES ;
29047 /**************************************************************************************/
29048 /* TIMER_DATA
29049  Summary:
29050  Holds TIMER_DATA used for the TIMER tasks.
29051  Description:
29052  Holds TIMER_DATA used for the TIMER tasks. The state machine and variables
29053  used to control TIMER functions are stored here.
29054  Remarks:
29055  None
29056  */
29057 
29058 typedef
29059  struct /* This structure collects the variables and states required for these*/
29060  {
29061  /* functions to operate.*/
29062  TIMER_STATES state ;
29063  DRV_HANDLE tmrDrvHandle ;/* Pointer to Timer Driver returned by DRV_TMR_Open().*/
29064  bool timer1_100uS_tick ;
29065  bool timer1_1mS_tick ;
29066  bool timer1_10mS_tick ;
29067  bool timer1_100mS_tick ;
29068  bool timer1_1000mS_tick ;
29069  uint8_t timer1_100uS_count ;
29070  uint8_t timer1_1mS_count ;
29071  uint8_t timer1_10mS_count ;
29072  uint8_t timer1_100mS_count ;
29073  uint8_t timer1_1000mS_count ;
29074  } TIMER_DATA ;
29075 
29076 extern TIMER_DATA
29077  TIMER ;
29078 /**************************************************************************************/
29079 /**************************************************************************************/
29080 /* State Machine Functions */
29081 /**************************************************************************************/
29082 /**************************************************************************************/
29083 /*!*************************************************************************************
29084  Function:
29085  void TIMER_Tasks(void)
29086  Summary:
29087  TIMER_Tasks function.
29088  Description:
29089  This routine is the TIMER_Tasks function. It defines the TIMER state machine and
29090  core logic.
29091  Precondition:
29092  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29093  should be called before calling this.
29094  Parameters:
29095  None.
29096  Returns:
29097  None.
29098  Example:
29099  TIMER_Tasks()
29100  Remarks:
29101  This routine must be called from APP_Tasks() routine.
29102  */
29103 
29104 void
29105  TIMER_Tasks ( void ) ;
29106  /* TIMERS_H */
29107 /***************************************************************************************
29108  End of File
29109  */
29110 
29111 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\timers.h*/
29112 /* CLOSE_FILE Include File */
29113 
29114 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h */
29115 /**************************************************************************************/
29129 /**************************************************************************************/
29130 #ifndef COMMANDS_H /* Guard against multiple inclusion.*/
29131 #define COMMANDS_H
29132 /**************************************************************************************/
29133 /**************************************************************************************/
29134 /* Section: Included Files */
29135 /**************************************************************************************/
29136 /**************************************************************************************/
29137 #include <stdbool.h>
29138 #include <stdint.h>
29139 /**************************************************************************************/
29140 /**************************************************************************************/
29141 /* Section: Global Variables */
29142 /**************************************************************************************/
29143 /**************************************************************************************/
29144 
29145 extern bool
29146  DepthStatus ;
29147 /**************************************************************************************/
29148 /**************************************************************************************/
29149 /* Section: Type Definition */
29150 /**************************************************************************************/
29151 /**************************************************************************************/
29152 
29153 typedef
29154 unsigned char
29155  uchar8_t ;
29156 /**************************************************************************************/
29157 /**************************************************************************************/
29158 /* Section: Data Types */
29159 /**************************************************************************************/
29160 /**************************************************************************************/
29161 /**************************************************************************************/
29162 
29163 typedef
29164  enum
29165  {
29170  } COMMAND_STATES ;
29171 
29172 typedef
29173  struct /* This structure collects the variables and states required for these*/
29174  {
29175  /* functions to operate.*/
29176  COMMAND_STATES state ;/* The COMMAND_TASKS machine current state.*/
29177  uint16_t crc ;
29178  uint8_t cmd_size ;
29179  uint8_t command [ 7 ] ;
29180  bool process_complete_flag ;
29181  bool b_command_complete_flag ;
29182  bool sw_status_bit_check ;
29183  } COMMAND_DATA ;
29184 
29185 extern COMMAND_DATA
29186  CMD ;
29187 /**************************************************************************************/
29188 /**************************************************************************************/
29189 /* Section: Interface Functions */
29190 /**************************************************************************************/
29191 /**************************************************************************************/
29192 /*!*************************************************************************************
29193  Function:
29194  void COMMAND_Tasks( void )
29195  Summary:
29196  This function executes the commands from the host.
29197  Description:
29198  This function executes the commands from the host. It does this by first ensuring
29199  the CRC of the received command is correct. If the CRC check matches, it goes on
29200  to execute the command. The commands are divided up into three types; Protocol A,
29201  Protocol B and System. Protocol A commands control the function of the Panel
29202  Interface Board. Protocol B commands are for a PerfSwitch or other down hole tool.
29203  System commands control the panel operation while it is being used for shooting.
29204  An example would be showing the depth status.
29205 
29206  Precondition:
29207  None.
29208  Parameters:
29209  None.
29210  Returns
29211  None.
29212 
29213  Remarks:
29214  None.
29215 
29216  Example:
29217  void COMMAND_Tasks()
29218  */
29219 
29220 void
29221  COMMAND_Tasks ( void ) ;
29222 /**************************************************************************************/
29223 /**************************************************************************************/
29224 /* Section: Local Functions */
29225 /**************************************************************************************/
29226 /**************************************************************************************/
29227 /*!*************************************************************************************
29228  Function:
29229  bool Valid_Command( uchar8_t msg )
29230  Summary:
29231  This function compares the received command(first byte)and compares it to a list
29232  of correct commands.
29233  Description:
29234  This function compares the received command(first byte)and compares it to a list
29235  of correct commands. If there is a match, the rest of the transmission is
29236  received for processing. Used in the ValidateComm function in commmodule.c
29237 
29238  Precondition:
29239  None.
29240  Parameters:
29241  uchar8_t msg - The one byte command to compare.
29242  Returns
29243  bool ans - true if command is valid.
29244 
29245  Remarks
29246  None.
29247 
29248  Example:
29249  Valid_Command( command )
29250  */
29251 
29252 bool
29253  Valid_Command (
29254  uchar8_t msg ) ;
29255 /*!*************************************************************************************
29256  Function:
29257  bool GetDepthStatus ( void )
29258  Summary:
29259  This function compares the received command(first byte)and compares it to a list
29260  of correct commands.
29261  Description:
29262  This function compares the received command(first byte)and compares it to a list
29263  of correct commands. If there is a match, the rest of the transmission is
29264  received for processing. Used in the ValidateComm function in commmodule.c
29265 
29266  Precondition:
29267  None.
29268  Parameters:
29269  unsigned char msg - The one byte command to compare.
29270  Returns
29271  unsigned short ans.
29272 
29273  Remarks
29274  None.
29275 
29276  Example:
29277  GetDepthStatus ( )
29278  */
29279 
29280 bool
29281  GetDepthStatus ( void ) ;
29282 /*!*************************************************************************************
29283  Function:
29284  static void Execute_Auto_Protocol_A (void)
29285  Summary:
29286  This function executes the Auto Protocol A commands.
29287  Description:
29288  This function executes the Auto Protocol A commands. These are commands that
29289  control the panel. The commands are listed as case statements. Once the action is
29290  completed, a response is generated and sent back to the host.
29291 
29292  Precondition:
29293  None.
29294  Parameters:
29295  None.
29296  Returns
29297  None.
29298 
29299  Remarks
29300  None.
29301 
29302  Example:
29303  Execute_Auto_Protocol_A ()
29304  */
29305 
29306 static void
29307  Execute_Auto_Protocol_A ( void ) ;
29308 /*!*************************************************************************************
29309  Function:
29310  static void Execute_Protocol_A (void)
29311  Summary:
29312  This function executes the Protocol A commands.
29313  Description:
29314  This function executes the Protocol A commands. These are commands that control
29315  the panel. The commands are listed as case statements. Once the action is
29316  completed, a response is generated and sent back to the host.
29317 
29318  Precondition:
29319  None.
29320  Parameters:
29321  None.
29322  Returns
29323  None.
29324 
29325  Remarks
29326  None.
29327 
29328  Example:
29329  ExecuteProtocolA ()
29330  */
29331 
29332 static void
29333  Execute_Protocol_A ( void ) ;
29334 /*!*************************************************************************************
29335  Function:
29336  static void Execute_Protocol_B (void)
29337  Summary:
29338  This function executes the Protocol B commands.
29339  Description:
29340  This function executes the Protocol B commands. These are commands that are for
29341  a PerfSwitch or other tool. The commands are listed as case statements. Once
29342  the action is completed, a response is generated and sent back to the host.
29343 
29344  Precondition:
29345  None.
29346  Parameters:
29347  None.
29348  Returns
29349  None.
29350 
29351  Remarks
29352  None.
29353 
29354  Example:
29355  ExecuteProtocolB ()
29356  */
29357 
29358 static void
29359  Execute_Protocol_B ( void ) ;
29360 /*!*************************************************************************************
29361  Function:
29362  static void Execute_System(void)
29363  Summary:
29364  This function executes the system commands.
29365  Description:
29366  This function executes the system commands. Once the action is completed, a
29367  response is generated and sent back to the host.
29368 
29369  Precondition:
29370  None.
29371  Parameters:
29372  None.
29373  Returns
29374  None.
29375 
29376  Remarks
29377  None.
29378 
29379  Example:
29380  ExecuteSystem()
29381  */
29382 
29383 static void
29384  Execute_System ( void ) ;
29385  /* COMMANDS_H */
29386 /***************************************************************************************
29387  End of File
29388  */
29389 
29390 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h*/
29391 /* CLOSE_FILE Include File */
29392 
29393 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h */
29394 /**************************************************************************************/
29411 /**************************************************************************************/
29412 #ifndef STATUSST_H /* Guard against multiple inclusion */
29413 #define STATUSST_H
29414 /**************************************************************************************/
29415 /**************************************************************************************/
29416 /* Section: Included Files */
29417 /**************************************************************************************/
29418 /**************************************************************************************/
29419 #include <stdbool.h>
29420 #include <stdint.h>
29421 /*typedef unsigned char uchar8_t*/
29422 /**************************************************************************************/
29423 /**************************************************************************************/
29424 /* Section: Interface Functions */
29425 /**************************************************************************************/
29426 /**************************************************************************************/
29427 /*!*************************************************************************************
29428  Function:
29429  void Set_Status(uint8_t bitposn)
29430  Summary:
29431  This function sets the desired bit to a one in the PIB status register.
29432  Description:
29433  This function sets the desired bit to a one in the PIB status register. This is
29434  called by various functions to indicate a command result or switch setting.
29435 
29436  Precondition:
29437  None.
29438  Parameters:
29439  uint8_t bitposn - the desired bit position in the PIB status register.
29440  Returns
29441  None.
29442 
29443  Remarks:
29444  None.
29445 
29446  Example:
29447  Set_Status(6)
29448  */
29449 
29450 void
29451  Set_Status (
29452  uint8_t bitposn ) ;
29453 /*!*************************************************************************************
29454  Function:
29455  void Clear_Status(unsigned short bitposn)
29456  Summary:
29457  This function sets the desired bit to a zero in the PIB status register.
29458  Description:
29459  This function sets the desired bit to a zero in the PIB status register. This is
29460  called by various functions to indicate a command result or switch setting.
29461 
29462  Precondition:
29463  None.
29464  Parameters:
29465  uint8_t bitposn - the desired bit position in the PIB status register.
29466  Returns
29467  None.
29468 
29469  Remarks:
29470  None.
29471 
29472  Example:
29473  ClearStatus(7)
29474  */
29475 
29476 void
29477  Clear_Status (
29478  uint8_t bitposn ) ;
29479 /*!*************************************************************************************
29480  Function:
29481  void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1 )
29482  Summary:
29483  Function to prepare the protocol A response.
29484  Description:
29485  Function to prepare the protocol A response. The return message is seven bytes.
29486  the first byte is the command that was sent. the next two bytes are the PIB status
29487  register. The next three bytes can contain two - 12 bit data fields. The data is
29488  then transferred to the TxFifo. The CRC for the return message is calculated
29489  and placed in the last byte.
29490 
29491  Precondition:
29492  None.
29493  Parameters:
29494  uint8_t byte - The command byte.
29495  uint16_t data2 - a 12 bit data field.
29496  uint16_t data1 - 1 12 bit data field.
29497  Returns
29498  None.
29499 
29500  Remarks:
29501  None.
29502 
29503  Example:
29504  Prepare_Return_A(CMD.COMMAND[ 0 ], 0, 0)
29505  */
29506 
29507 void
29509  uint8_t byte ,
29510  uint16_t data2 ,
29511  uint16_t data1 ) ;
29512 /*!*************************************************************************************
29513  Function:
29514  void Prepare_Return_B(uint8_t byt[] )
29515  Summary:
29516  Function to prepare the protocol B response.
29517  Description:
29518  Function to prepare the protocol B response. The return message is seven bytes.
29519  the first byte is the command that was sent. the next two bytes are the PIB status
29520  register. The next three bytes can contain a 12 bit Switch status register,
29521  a four bit StateID and an 8 bit Switch ID. The data is then transferred to the
29522  TxFifo. The CRC for the return message is calculated and placed in the last byte.
29523 
29524  Precondition:
29525  None.
29526  Parameters:
29527  uint8_t byt[] - Three received bytes from a PerfSwitch.
29528  Returns
29529  None.
29530 
29531  Remarks:
29532  None.
29533 
29534  Example:
29535  Prepare_Return_B( MAN.msg )
29536  */
29537 
29538 void
29540  uint8_t byt [] ) ;
29541  /* STATUSST_H */
29542 /***************************************************************************************
29543  End of File
29544  */
29545 
29546 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h*/
29547 /* CLOSE_FILE Include File */
29548 
29549 #include <stdbool.h>
29550 #include <stdint.h>
29551 #include <stdlib.h>
29552 /**************************************************************************************/
29553 /**************************************************************************************/
29554 /* Section: Structure Data and Local Variables */
29555 /**************************************************************************************/
29556 /**************************************************************************************/
29557 /* MAN Data
29558  Summary:
29559  These structures hold required data.
29560  Description:
29561  These structures hold required data. These are here to link these
29562  structures for use by the local functions.
29563  Remarks:
29564  These structures should be initialized by the APP_Initialize function.
29565 
29566  These are defined in man.h
29567 */
29568 
29571 
29572 MAN_DATA
29574 
29575 static MAN_STATES
29577 
29578 static MAN_RX_STATES
29580 
29581 static MAN_PROCESS_STATES
29583 /***************************************************************************************
29584  * $GLOBAL VARIABLES
29585 ***************************************************************************************/
29586 
29587 static uint32_t
29589 
29590 static uint8_t
29592 
29593 uint8_t
29595 /***************************************************************************************
29596  * $LOCAL VARIABLES
29597 ***************************************************************************************/
29598 
29599 static const uint8_t
29600  biasval [ 48U ] = { /* 48 possible MAN_BIAS DAC values.*/
29601  0x18U , 0x1DU , 0x22U , 0x26U , 0x2BU , 0x30U , 0x35U , 0x39U , 0x3EU , 0x43U , 0x48U , 0x4CU , 0x51U , 0x56U , 0x5BU , 0x5FU , 0x64U , 0x69U , 0x6EU , 0x72U , 0x77U , 0x7CU , 0x81U , 0x85U , 0x8AU , 0x8FU , 0x94U ,
29602  0x98U , 0x9DU , 0xA2U , 0xA7U , 0xABU , 0xB0U , 0xB5U , 0xBAU , 0xBEU , 0xC3U , 0xC8U , 0xCDU , 0xD1U , 0xD6U , 0xDBU , 0xE0U , 0xE4U , 0xE9U , 0xEEU , 0xF3U , 0xFFU } ;
29603 /**************************************************************************************/
29604 /**************************************************************************************/
29605 /* Section: SPI Callback Functions */
29606 /**************************************************************************************/
29607 /**************************************************************************************/
29608 
29609 static void
29611  DRV_SPI_BUFFER_EVENT event ,
29612  DRV_SPI_BUFFER_HANDLE bufferHandle ,
29613  void * context )
29614  {
29615  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
29616  if
29617  (
29619  )
29620  {
29621  ((int)(bitmapstruct.element1 |= (1 << 29))); /* 1 */
29622  {
29623  MAN.spi_write_complete_flag = true ;
29624  }
29625  } else ((int)(bitmapstruct.element1 |= (1 << 30))); /* 4 */
29626  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 30 */
29627  man_59zqendz ( 64 ) ; /* 30 */
29628  }
29629 /**************************************************************************************/
29630 /**************************************************************************************/
29631 /* Section: State Machine Functions */
29632 /**************************************************************************************/
29633 /**************************************************************************************/
29634 /***************************************************************************************
29635  Function:
29636  void MAN_Tasks( ( void )
29637  Summary:
29638  This routine is the MAN tasks function. It defines the (MAN) state machine and
29639  core logic.
29640  Remarks:
29641  Refer to the man.h interface header for function usage details.
29642  */
29643 
29644 void
29645  MAN_Tasks ( void ) /* MAN state machine.*/
29646  {
29647  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 0))); /* 37 */
29648  switch (
29649  ( ( int )( /* 29 */
29650  MAN.state
29651  ))*
29652  ((bitmapstruct.element2 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ) /* 19 */
29653  ) /* Check the machines current state.*/
29654  {
29655  case MAN_STATE_INIT :
29656  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 2) : 0)), 1 ); /* 41 */
29657  /* This machines initial state.*/
29658  {
29659  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 23 */
29660 
29661  Init_Manchester () ; /* Initialize variables.*/
29662  MAN.state = MAN_STATE_INIT_SPI_MAN ; /* Move on to open SPI port.*/
29663  }
29664  ((int)(bitmapstruct.element2 |= (1 << 4))); /* 16 */
29665  goto l129505 ;
29666  case MAN_STATE_INIT_SPI_MAN :
29667  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ); /* 41 */
29668  {
29669  if
29670  (
29671  MAN_BIAS.spi_bias_fsk == (
29672  (
29673  ( DRV_HANDLE ) - 1 ) )
29674  ) /* Open SPI port for Manchester Bias DAC.*/
29675  {
29676  ((int)(bitmapstruct.element2 |= (1 << 6))); /* 1 */
29677  {
29678  MAN_BIAS.spi_bias_fsk = DRV_SPI_Open ( 0 , /* Uses SPI instance 0 using SPI module 1.*/
29680  }
29681  } else ((int)(bitmapstruct.element2 |= (1 << 7))); /* 4 */
29682  if
29683  (
29684  MAN_BIAS.spi_bias_fsk != (
29685  (
29686  ( DRV_HANDLE ) - 1 ) )
29687  ) /* If the SPI port for the MAN_BIAS control DAC has been opened,*/
29688  {
29689  ((int)(bitmapstruct.element2 |= (1 << 8))); /* 1 */
29690  {
29691  ((int)(bitmapstruct.element2 |= (1 << 9))); /* 23 */
29692 
29693  Set_Bias (
29694  10 ) ; /* Set the MAN_BIAS DAC to a low current setting.*/
29695  MAN.state = MAN_STATE_IDLE ; /* Set this machine to idle.*/
29696  }
29697  } else ((int)(bitmapstruct.element2 |= (1 << 10))); /* 4 */
29698  }
29699  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 16 */
29700  goto l129505 ;
29701  case MAN_STATE_IDLE :
29702  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 12) : 0)), 1 ); /* 41 */
29703  {
29704  /* Wait here until a response needs to be received and processed.*/
29705  }
29706  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 16 */
29707  goto l129505 ;
29709  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 14) : 0)), 1 ); /* 41 */
29710  /* Machine comes here from the FSK_SEND_MESSAGE task.*/
29711  {
29712  MAN.Rx_state = MAN_RX_STATE_PREAMBLE ; /* Move the Manchester receive state machine to receive the preamble.*/
29713  MAN.cnt_preamble = 0U ; /* Reset the preamble index count.*/
29714  DRV_TMR2_CounterClear () ; /* Reset the Timer 2 count.*/
29715  ( void ) DRV_TMR2_Start () ;/* Start the timer again.*/
29716  MAN.state = MAN_STATE_RECEIVE_WAIT ; /* Move on to wait for the Manchester reception timer to complete.*/
29717  }
29718  ((int)(bitmapstruct.element2 |= (1 << 15))); /* 16 */
29719  goto l129505 ;
29720  case MAN_STATE_RECEIVE_WAIT :
29721  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 16) : 0)), 1 ); /* 41 */
29722  /* Wait for the 130mS MAN timer count to complete.*/
29723  {
29724  if
29725  (
29726  MAN.tick == true
29727  ) /* 10mS tick has elapsed.*/
29728  {
29729  ((int)(bitmapstruct.element2 |= (1 << 17))); /* 1 */
29730  {
29731  MAN.tick = false ; /* Reset the flag.*/
29732  if
29733  (
29735  ) /* If 130mS has elapsed,*/
29736  {
29737  ((int)(bitmapstruct.element2 |= (1 << 18))); /* 1 */
29738  {
29739  MAN.timer_count = 0U ; /* Reset the timer count.*/
29740  MAN.cnt_preamble = 0U ; /* Reset the preamble index count.*/
29741  MAN.Rx_state = MAN_RX_STATE_IDLE ; /* Move the Manchester receive state machine to its idle state.*/
29742  MAN.Process_state = MAN_PROCESS_STATE_PARSE ; /* Initiate the MAN_PROCESS_Tasks state machine to begin parsing the response.*/
29743  MAN.state = MAN_STATE_PROCESS ; /* Move on to process the response.*/
29744  }
29745  ((int)(bitmapstruct.element2 |= (1 << 19))); /* 3 */
29746  }
29747  else /* Otherwise,*/
29748  {
29749  ((int)(bitmapstruct.element2 |= (1 << 20))); /* 2 */
29750  {
29751  MAN.timer_count = MAN.timer_count + 1U ; /* Increment the counter.*/
29752  }
29753  }
29754  }
29755  } else ((int)(bitmapstruct.element2 |= (1 << 21))); /* 4 */
29756  }
29757  ((int)(bitmapstruct.element2 |= (1 << 22))); /* 16 */
29758  goto l129505 ;
29759  case MAN_STATE_PROCESS :
29760  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
29761  {
29762  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 23 */
29763 
29764  MAN_PROCESS_Tasks () ; /* Process the Manchester response.*/
29765  if
29766  ( /* 50 */
29767  (
29768 
29769  ( /* 52 */
29770  (
29771  MAN.process_complete_flag == true
29772  )
29773  ? (bitmapstruct.element2 |= (1 << 25 ), 1)
29774  : (bitmapstruct.element2 |= (1 << 26 ), 0) ) /* 54 */
29775  &&
29776  ( MAN.error == false )
29777  ) /* If we have completed the processing,*/
29778  ) /* 1 */
29779  {
29780  ((int)(bitmapstruct.element2 |= (1 << 27))); /* 1 */
29781  {
29782  CMD.b_command_complete_flag = true ; /* Set this flag to show we have completed a Protocol B command.*/
29783  MAN.process_complete_flag = false ; /* Reset the flag so we can process another response.*/
29784  MAN.state = MAN_STATE_IDLE ; /* Set this machine to idle to wait for another response.*/
29786  MAN.trynumber = 0x02 ;
29787  }
29788  } else ((int)(bitmapstruct.element2 |= (1 << 28))); /* 4 */
29789  if
29790  (
29791  MAN.error == true
29792  )
29793  {
29794  ((int)(bitmapstruct.element2 |= (1 << 29))); /* 1 */
29795  {
29796  MAN.error = false ;
29797  MAN.process_complete_flag = false ; /* Reset the flag so we can process another response.*/
29798  MAN.state = MAN_STATE_IDLE ; /* Set this machine to idle to wait for another response.*/
29800  }
29801  } else ((int)(bitmapstruct.element2 |= (1 << 30))); /* 4 */
29802  }
29803  ((int)(bitmapstruct.element2 |= (1 << 31))); /* 16 */
29804  goto l129505 ;
29805  default :
29806  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
29807  {
29808  /*Comment.*/
29809  }
29810  ((int)(bitmapstruct.element3 |= (1 << 1))); /* 16 */
29811  goto l129505 ;
29812  }
29813 l129505 :
29814  ; /* 18 */
29815  ((int)(bitmapstruct.element3 |= (1 << 2))); /* 30 */
29816  man_59zqendz ( 99 ) ; /* 30 */
29817  }
29818 /***************************************************************************************
29819  Function:
29820  void MAN_RX_Tasks( void )
29821  Summary:
29822  This routine is the MAN_RX_Tasks function. It defines the MAN_RX state machine and
29823  core logic.
29824  Remarks:
29825  Refer to the man.h interface header for function usage details.
29826  */
29827 
29828 void
29829  MAN_RX_Tasks ( void )
29830  {
29831  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 3))); /* 37 */
29832  uint32_t
29833  timer_value ;
29834  switch (
29835  ( ( int )( /* 29 */
29836  MAN.Rx_state
29837  ))*
29838  ((bitmapstruct.element3 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ) /* 19 */
29839  )
29840  {
29841  case MAN_RX_STATE_IDLE :
29842  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ); /* 41 */
29843  {
29844  count = 0U ; /* Reset counter after every message.*/
29845  }
29846  ((int)(bitmapstruct.element3 |= (1 << 6))); /* 16 */
29847  goto l129607 ;
29848  case MAN_RX_STATE_PREAMBLE :
29849  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
29850  /* Looking for 1111 at he start of a PerfSwitch response.*/
29851  {
29852  timer_value = DRV_TMR2_CounterValueGet () ; /* Record the timer count when the a change was detected on the port pin.*/
29853  man_timer_count[ count ] = timer_value ;/* Debug only. Store timer values.*/
29854  count = count + 1U ;
29855  if
29856  ( /* 50 */
29857  (
29858 
29859  ( /* 52 */
29860  (
29861  timer_value >= 2000U
29862  )
29863  ? (bitmapstruct.element3 |= (1 << 8 ), 1)
29864  : (bitmapstruct.element3 |= (1 << 9 ), 0) ) /* 54 */
29865  &&
29866  ( timer_value <= 11800U )
29867  )
29868  ) /* 1 */
29869  {
29870  ((int)(bitmapstruct.element3 |= (1 << 10))); /* 1 */
29871  {
29872  MAN.preamble[ MAN.cnt_preamble ] = ( uint16_t ) timer_value ;/* Store the timer_value for later use in FSK scaling.*/
29873  MAN.cnt_preamble ++ ;/* Increment index counter.*/
29874  }
29875  } else ((int)(bitmapstruct.element3 |= (1 << 11))); /* 4 */
29876  if
29877  (
29878  MAN.cnt_preamble >= 5U
29879  ) /* If we have received all four preamble bits,*/
29880  {
29881  ((int)(bitmapstruct.element3 |= (1 << 12))); /* 1 */
29882  {
29883  MAN.Rx_state = MAN_RX_STATE_DATA ;/* move on to record the data.*/
29884  }
29885  } else ((int)(bitmapstruct.element3 |= (1 << 13))); /* 4 */
29886  }
29887  ((int)(bitmapstruct.element3 |= (1 << 14))); /* 16 */
29888  goto l129607 ;
29889  case MAN_RX_STATE_DATA :
29890  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 15) : 0)), 1 ); /* 41 */
29891  /* Write TMR2 value into buffer if it falls within a half or*/
29892  { /* a one bit boundary along with the pin value.*/
29893  timer_value = DRV_TMR2_CounterValueGet () ; /* Record the timer count when the a change was detected on the port pin.*/
29894  man_timer_count[ count ] = timer_value ;/* Debug only. Store timer values.*/
29895  count = count + 1U ;
29896  if
29897  ( /* 50 */
29898  (
29899 
29900  ( /* 52 */
29901  (
29902  timer_value >= 2000U
29903  )
29904  ? (bitmapstruct.element3 |= (1 << 16 ), 1)
29905  : (bitmapstruct.element3 |= (1 << 17 ), 0) ) /* 54 */
29906  &&
29907  ( timer_value <= 11800U )
29908  ) /* If the timer value is within the half bit range,*/
29909  ) /* 1 */
29910  {
29911  ((int)(bitmapstruct.element3 |= (1 << 18))); /* 1 */
29912  {
29913  MAN.time[ fnp ] = 0x12U ;
29914  /* Write HalfBit value into buffer.*/
29915  /* LDRA_INSPECTED 93 S
29916 */
29917  /* LDRA_INSPECTED 136 S
29918 */ /* & operation is correct.*/
29919  MAN.level[ fnp ] = ( uint8_t ) ( ~ PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 ) ) & 0x01U ;/* Write Pin value into buffer. Bitwise not & with 1.*/
29920  fnp ++ ;
29921  }
29922  } else ((int)(bitmapstruct.element3 |= (1 << 19))); /* 4 */
29923  if
29924  ( /* 50 */
29925  (
29926 
29927  ( /* 52 */
29928  (
29929  timer_value >= 11801U
29930  )
29931  ? (bitmapstruct.element3 |= (1 << 20 ), 1)
29932  : (bitmapstruct.element3 |= (1 << 21 ), 0) ) /* 54 */
29933  &&
29934  ( timer_value <= 20000U )
29935  ) /* If the timer value is within the full bit timer range,*/
29936  ) /* 1 */
29937  {
29938  ((int)(bitmapstruct.element3 |= (1 << 22))); /* 1 */
29939  {
29940  MAN.time[ fnp ] = 0x10U ;
29941  /* Write FullBit value into buffer.*/
29942  /* LDRA_INSPECTED 93 S
29943 */
29944  /* LDRA_INSPECTED 136 S
29945 */ /* & operation is correct.*/
29946  MAN.level[ fnp ] = ( uint8_t ) ( ~ PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 ) ) & 0x01U ;/* Write Pin value into buffer. Bitwise not & with 1.*/
29947  fnp ++ ;
29948  }
29949  } else ((int)(bitmapstruct.element3 |= (1 << 23))); /* 4 */
29950  }
29951  ((int)(bitmapstruct.element3 |= (1 << 24))); /* 16 */
29952  goto l129607 ;
29953  default :
29954  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 25) : 0)), 1 ); /* 41 */
29955  {
29956  /*Comment.*/
29957  }
29958  ((int)(bitmapstruct.element3 |= (1 << 26))); /* 16 */
29959  goto l129607 ;
29960  }
29961 l129607 :
29962  ; /* 18 */
29963  DRV_TMR2_CounterClear () ;/* Reset the Timer 2 count.*/
29964  ( void ) DRV_TMR2_Start () ;/* Start Timer 2.*/
29965  ((int)(bitmapstruct.element3 |= (1 << 27))); /* 30 */
29966  man_59zqendz ( 124 ) ; /* 30 */
29967  }
29968 /***************************************************************************************
29969  Function:
29970  static void MAN_PROCESS_Tasks( void )
29971  Summary:
29972  This routine is the MAN_PROCESS_Tasks function. It defines the (MAN_PROCESS)
29973  state machine and core logic.
29974  Remarks:
29975  Refer to the man.h interface header for function usage details.
29976  */
29977 
29978 static void
29980  {
29981  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 28))); /* 37 */
29982  switch (
29983  ( ( int )( /* 29 */
29985  ))*
29986  ((bitmapstruct.element3 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ) /* 19 */
29987  )
29988  {
29989  case MAN_PROCESS_STATE_IDLE :
29990  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
29991  /* Wait to process another message.*/
29992  {
29993  }
29994  ((int)(bitmapstruct.element3 |= (1 << 31))); /* 16 */
29995  goto l129660 ;
29997  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
29998  /* Started in Manchester timer expires.*/
29999  {
30000  ((int)(bitmapstruct.element4 |= (1 << 1))); /* 23 */
30001 
30002  Decode_Manchester () ; /* Decode received Manchester array.*/
30003  ((int)(bitmapstruct.element4 |= (1 << 2))); /* 23 */
30004 
30005  Package_Manchester () ; /* Convert to a 4 Byte Array.*/
30006  MAN.Process_state = MAN_PROCESS_STATE_TEST ; /* Move on to see if it is a valid message.*/
30007  }
30008  ((int)(bitmapstruct.element4 |= (1 << 3))); /* 16 */
30009  goto l129660 ;
30010  case MAN_PROCESS_STATE_TEST :
30011  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
30012  {
30013  ((int)(bitmapstruct.element4 |= (1 << 5))); /* 23 */
30014 
30015  Test_Manchester () ; /* Test if we received a good Manchester response.*/
30016  ((int)(bitmapstruct.element4 |= (1 << 6))); /* 23 */
30017 
30018  Flush_Buffer_Manchester () ; /* Flush the Manchester buffers for another message.*/
30019  fnp = 0U ; /* Reset index counter for storing incoming Manchester message.*/
30020  count = 0U ;
30021  MAN.process_complete_flag = true ; /* Set flag to show Manchester processing is complete.*/
30022  MAN.Process_state = MAN_PROCESS_STATE_IDLE ; /* Set this machine to idle.*/
30023  }
30024  ((int)(bitmapstruct.element4 |= (1 << 7))); /* 16 */
30025  goto l129660 ;
30026  default :
30027  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
30028  {
30029  /*Comment.*/
30030  }
30031  ((int)(bitmapstruct.element4 |= (1 << 9))); /* 16 */
30032  goto l129660 ;
30033  }
30034 l129660 :
30035  ; /* 18 */
30036  ((int)(bitmapstruct.element4 |= (1 << 10))); /* 30 */
30037  man_59zqendz ( 139 ) ; /* 30 */
30038  }
30039 /**************************************************************************************/
30040 /**************************************************************************************/
30041 /* Section: Local Functions */
30042 /**************************************************************************************/
30043 /**************************************************************************************/
30044 /*!*************************************************************************************
30045  Function:
30046  static void Init_Manchester( void )
30047  Summary:
30048  Function to initialize Manchester parameters.
30049  Remarks:
30050  Refer to the man.h interface header for function usage details.
30051  */
30052 
30053 static void
30055  {
30056  int izzqqzz=((int)(bitmapstruct.element4 |= (1 << 11))); /* 37 */
30057  fnp = 0U ; /* Initialize index counter for storing incoming Manchester message.*/
30058  MAN_BIAS.dac_a_setting = 0x0300 ;/* Sets the SPI message to write to the DAC A output only.*/
30060  (
30061  ( DRV_HANDLE ) - 1 ) ) ; /* Set the MAN_BIAS SPI Port handle to invalid.*/
30062  MAN.process_complete_flag = false ;/* Flag to show if we have completed the Manchester processing task.*/
30063  MAN.trynumber = 0x02 ; /* Set this to the default value.*/
30064  MAN.Rx_state = MAN_RX_STATE_IDLE ;/* This Manchester receive state machine is in the change notice ISR. Set it to idle.*/
30065  MAN.Process_state = MAN_PROCESS_STATE_IDLE ;/* Set the Manchester process state machine to idle.*/
30066  MAN.spi_write_complete_flag = false ;/* Set this flag to show we have not completed an SPI write to the MAN_BIAS DAC.*/
30067  MAN.spi_sent_flag = false ;/* Set this flag to show we have not sent an SPI message to the MAN_BIAS DAC.*/
30068  MAN.timer_count = 0U ;/* Reset the 10mS timer count to 0.*/
30069  MAN.timer_complete = 13 ;/* Set the max number of timer counts to reflect 130mS.*/
30070  MAN.bad_crc = false ;
30071  MAN_BIAS.dac_b_setting = 0x2700 ;/* Sets the SPI message to write to the DAC B output only.*/
30072  MAN_BIAS.hi_current = 90.0F ;/* 90mA WL_CPS current.*/
30073  MAN_BIAS.lo_current = 30.0F ;/* 30mA WL_CPS current.*/
30074  MAN_BIAS.hi_volts = 5.0F ;/* Maximum MAN_BIAS DAC output.*/
30075  MAN_BIAS.lo_volts = 1.81F ;
30076  /* MAN_BIAS_DAC output with 30mA WL_CPS current.*/
30077  /*MAN_BIAS.LO_VOLTS = 0.468*/
30078  if
30079  (
30080  ( MAN_BIAS.hi_current - MAN_BIAS.lo_current ) > 0.0F
30081  ) /* Ensure the denominators are not zero,(MISRA)*/
30082  {
30083  ((int)(bitmapstruct.element4 |= (1 << 12))); /* 1 */
30084  {
30087  }
30088  } else ((int)(bitmapstruct.element4 |= (1 << 13))); /* 4 */
30090  MAN.error = false ;/* Flag to show if a Manchester error has occurred.*/
30091  MAN.manual_bias_flag = false ;/* Flag to indicate if the manual DAC bias setting is used.*/
30092  MAN.tick = false ;/* Reset the timer tick flag.*/
30093  MAN.crc = 0U ;
30094  ((int)(bitmapstruct.element4 |= (1 << 14))); /* 30 */
30095  man_59zqendz ( 143 ) ; /* 30 */
30096  }
30097 /*!*************************************************************************************
30098  Function:
30099  static void Decode_Manchester( void )
30100  Summary:
30101  Function to decode the Manchester response from a PerfSwitch.
30102  Remarks:
30103  Refer to the man.h interface header for function usage details.
30104  */
30105 
30106 static void
30108  {
30109  int izzqqzz=((int)(bitmapstruct.element4 |= (1 << 15))); /* 37 */
30110  uint8_t
30111  cnt ;
30112  uint8_t
30113  cnt2 ;
30114  cnt = 0U ; /* Counter for incoming buffer.*/
30115  cnt2 = 0U ; /* Counter for Manchester answer.*/
30116  while
30117  (
30118  ( /* 21 */
30119  cnt2 < ( 32U + 2U )
30120  ) /* 7 */
30121  ) /* While No of Manchester Bits + 2*/
30122  {
30123  { /* 32 */
30124  int zzqqzs = ((int)(bitmapstruct.element4 |= (1 << 16))); /* 32a */
30125  /* 2 extra transitions to accommodate the 1st (tickle) bit*/
30126  /* of the pre-amble.*/
30127  if
30128  (
30129  MAN.level[ cnt ] == 0x01U
30130  ) /* If the present level is a 1 then it must be a One Bit.*/
30131  {
30132  ((int)(bitmapstruct.element4 |= (1 << 17))); /* 1 */
30133  {
30134  MAN.ans[ cnt2 ] = 0x01U ;/* Set the answer to a one.*/
30135  }
30136  ((int)(bitmapstruct.element4 |= (1 << 18))); /* 3 */
30137  }
30138  else /* Otherwise,*/
30139  {
30140  ((int)(bitmapstruct.element4 |= (1 << 19))); /* 2 */
30141  {
30142  MAN.ans[ cnt2 ] = 0x00U ;/* Set the answer to a zero.*/
30143  }
30144  }
30145  if
30146  (
30147  MAN.time[ cnt + 1U ] == 0x12U
30148  ) /* If the time of next array element i.e.*/
30149  {
30150  ((int)(bitmapstruct.element4 |= (1 << 20))); /* 1 */
30151  {/* the other part of the waveform is a Half bit then*/
30152  cnt ++ ;/* increment the incoming buffer counter twice.*/
30153  cnt ++ ;
30154  }
30155  ((int)(bitmapstruct.element4 |= (1 << 21))); /* 3 */
30156  }
30157  else /* Else increment only once.*/
30158  {
30159  ((int)(bitmapstruct.element4 |= (1 << 22))); /* 2 */
30160  {
30161  cnt ++ ;
30162  }
30163  }
30164  cnt2 ++ ;/* Answer counter to be incremented by only one.*/
30165  ((int)(bitmapstruct.element4 |= (1 << 23))); /* 6 */
30166  }
30167  }
30168  ((int)(bitmapstruct.element4 |= (1 << 24))); /* 5 */
30169  ((int)(bitmapstruct.element4 |= (1 << 25))); /* 30 */
30170  man_59zqendz ( 154 ) ; /* 30 */
30171  }
30172 /*!*************************************************************************************
30173  Function:
30174  static void Package_Manchester( void )
30175  Summary:
30176  Manchester is decoded, the 1 X 32 answer array is packed into
30177  a 4 X 8 bit message array.
30178  Remarks:
30179  Refer to the man.h interface header for function usage details.
30180  */
30181 
30182 static void
30184  {
30185  int izzqqzz=((int)(bitmapstruct.element4 |= (1 << 26))); /* 37 */
30186  uint8_t
30187  cnt2 ; /* Counter for the MAnchester answer array.*/
30188  for
30189  (
30190  cnt2 = 0U
30191  ;
30192  ( /* 28 */
30193  cnt2 < 8U
30194  ) /* 7 */
30195  ;
30196  ( /* 7 */
30197  cnt2 ++
30198  , ((int)(bitmapstruct.element4 |= (1 << 27))) /* 27b */
30199  , ((int)(bitmapstruct.element4 |= (1 << 28)))) /* 27e */
30200  ) /* Package Manchester bits.*/
30201  {
30202  { /* 32 */
30203  int QZZZ = ((int)(bitmapstruct.element4 |= (1 << 29))); /* 32 */
30204  MAN.msg[ 0 ] = MAN.msg[ 0 ] | MAN.ans[ cnt2 + 1U ] ; /* First byte of message array takes answer array elements 1 through 8.*/
30205  MAN.msg[ 1 ] = MAN.msg[ 1 ] | MAN.ans[ cnt2 + 9U ] ; /* Second byte of message array takes answer array elements 9 through 16.*/
30206  MAN.msg[ 2 ] = MAN.msg[ 2 ] | MAN.ans[ cnt2 + 17U ] ; /* Third byte of message array takes answer array elements 17 through 24.*/
30207  MAN.msg[ 3 ] = MAN.msg[ 3 ] | MAN.ans[ cnt2 + 25U ] ; /* Fourth byte of message array takes answer array elements 25 through 32.*/
30208  if
30209  (
30210  cnt2 < 7U
30211  )
30212  {
30213  ((int)(bitmapstruct.element4 |= (1 << 30))); /* 1 */
30214  {
30215  MAN.msg[ 0 ] = MAN.msg[ 0 ] << 1 ;/* Left-shift message elements to make room for next array answer element.*/
30216  MAN.msg[ 1 ] = MAN.msg[ 1 ] << 1 ;
30217  MAN.msg[ 2 ] = MAN.msg[ 2 ] << 1 ;
30218  MAN.msg[ 3 ] = MAN.msg[ 3 ] << 1 ;
30219  }
30220  } else ((int)(bitmapstruct.element4 |= (1 << 31))); /* 4 */
30221  ((int)(bitmapstruct.element5 |= (1 << 0))); /* 6 */
30222  }
30223  } /* Package Manchester bits Ends.*/
30224  ((int)(bitmapstruct.element5 |= (1 << 1))); /* 5 */
30225  ((int)(bitmapstruct.element5 |= (1 << 2))); /* 30 */
30226  man_59zqendz ( 163 ) ; /* 30 */
30227  }
30228 /***************************************************************************************
30229  Function:
30230  static bool Check_Manchester( void )
30231  Summary:
30232  This function checks for valid Manchester response.
30233  Remarks:
30234  Refer to the man.h interface header for function usage details.
30235  */
30236 
30237 static bool
30239  {
30240  int izzqqzz=((int)(bitmapstruct.element5 |= (1 << 3))); /* 37 */
30241  bool
30242  ans ; /* Response for the Manchester test.*/
30243  if
30244  ( /* 50 */
30245  (
30246 
30247  ( /* 52 */
30248  (
30249  MAN.msg[ 0 ] == 0x00U
30250  )
30251  ? (bitmapstruct.element5 |= (1 << 4 ), 1)
30252  : (bitmapstruct.element5 |= (1 << 5 ), 0) ) /* 54 */
30253  &&
30254  ( MAN.msg[ 1 ] == 0x00U )
30255  ) /* If the first two bytes are 0x00,*/
30256  ) /* 1 */
30257  {
30258  ((int)(bitmapstruct.element5 |= (1 << 6))); /* 1 */
30259  {
30260  ans = false ; /* then we did not receive a valid response.*/
30261  }
30262  ((int)(bitmapstruct.element5 |= (1 << 7))); /* 3 */
30263  }
30264  else /* Otherwise,*/
30265  {
30266  ((int)(bitmapstruct.element5 |= (1 << 8))); /* 2 */
30267  {
30268  ans = true ; /* we did receive a valid response.*/
30269  }
30270  }
30271  ((int)(bitmapstruct.element5 |= (1 << 9))); /* 30 */
30272  man_59zqendz ( 170 ) ; /* 30 */
30273  return
30274  ans ;
30275  }
30276 /*!*************************************************************************************
30277  Function:
30278  static void Test_Manchester(void)
30279  Summary:
30280  Function to test the returned Manchester message.
30281  Remarks:
30282  Refer to the man.h interface header for function usage details.
30283  */
30284 
30285 static void
30287  {
30288  int izzqqzz=((int)(bitmapstruct.element5 |= (1 << 10))); /* 37 */
30289  if
30290  ( /* 50 */
30291  (
30292  ((int)(bitmapstruct.element5 |= (1 << 11))) , /* 23e */
30293  Check_Manchester () == true
30294  ) /* Check if we received any data,*/
30295  ) /* 1 */
30296  {
30297  ((int)(bitmapstruct.element5 |= (1 << 12))); /* 1 */
30298  {
30299  MAN.crc = Calc_CRC_Uplink ( 3 , MAN.msg ) ;/* Calculate CRC for the received message.*/
30300  if
30301  ( /* 50 */
30302  (
30303 
30304  ( /* 52 */
30305  (
30306  MAN.crc == MAN.msg[ 3 ]
30307  )
30308  ? (bitmapstruct.element5 |= (1 << 13 ), 1)
30309  : (bitmapstruct.element5 |= (1 << 14 ), 0) ) /* 54 */
30310  &&
30311 
30312  ( /* 52 */
30313  (
30314  ( MAN.msg[ 0 ] & 0x07U ) == 0U
30315  ) /* If the CRC is correct and there are no errors in the response*/
30316  ? (bitmapstruct.element5 |= (1 << 15 ), 1)
30317  : (bitmapstruct.element5 |= (1 << 16 ), 0) ) /* 54 */
30318  &&
30319  ( CMD.sw_status_bit_check == true )
30320  ) /* and the command is not returning any data,*/
30321  ) /* 1 */
30322  {
30323  ((int)(bitmapstruct.element5 |= (1 << 17))); /* 1 */
30324  {
30325  Clear_Status ( 12 ) ;/* Clear the 12th Status bit to show a good CRC.*/
30326  Prepare_Return_B ( MAN.msg ) ;/* Prepare the Protocol B return message.*/
30327  MAN.error = false ;/* Reset Manchester error flag.*/
30328  }
30329  ((int)(bitmapstruct.element5 |= (1 << 18))); /* 3 */
30330  }
30331  else
30332  {
30333  ((int)(bitmapstruct.element5 |= (1 << 19))); /* 2 */
30334  {
30335  if
30336  ( /* 50 */
30337  (
30338 
30339  ( /* 52 */
30340  (
30341  MAN.crc == MAN.msg[ 3 ]
30342  )
30343  ? (bitmapstruct.element5 |= (1 << 20 ), 1)
30344  : (bitmapstruct.element5 |= (1 << 21 ), 0) ) /* 54 */
30345  &&
30346  ( CMD.sw_status_bit_check == false )
30347  ) /* If the CRC is correct and the command is returning data,*/
30348  ) /* 1 */
30349  {
30350  ((int)(bitmapstruct.element5 |= (1 << 22))); /* 1 */
30351  {
30352  CMD.sw_status_bit_check = true ;/* Reset the flag.*/
30353  Clear_Status ( 12 ) ;/* Clear the 12th Status bit to show a good CRC.*/
30354  Prepare_Return_B ( MAN.msg ) ;/* Prepare the Protocol B return message.*/
30355  MAN.error = false ;/* Reset Manchester error flag.*/
30356  }
30357  ((int)(bitmapstruct.element5 |= (1 << 23))); /* 3 */
30358  }
30359  else/* Otherwise, we did not get a proper message.*/
30360  {
30361  ((int)(bitmapstruct.element5 |= (1 << 24))); /* 2 */
30362  {
30363  Set_Status ( 12 ) ;/* Set the 12th Status bit to show a bad CRC.*/
30364  MAN.error = true ;/* Set flag to show there was an error in the Manchester response.*/
30365  ((int)(bitmapstruct.element5 |= (1 << 25))); /* 23 */
30367  Calc_Fsk_Scaling () ; /* Calculate FSK Frequency Scaling.*/
30368  Generate_Sine_Wave_Data ( FSK.TABLE_MOD[ FSK.table_count ] ) ;/* Adjust the FSK data spacing.*/
30369  FSK.table_count = FSK.table_count + 1U ;
30370  if
30371  (
30372  FSK.table_count > 49U
30373  )
30374  {
30375  ((int)(bitmapstruct.element5 |= (1 << 26))); /* 1 */
30376  {
30377  FSK.table_count = 0U ;
30378  }
30379  } else ((int)(bitmapstruct.element5 |= (1 << 27))); /* 4 */
30380  MAN.trynumber ++ ;/* Increment the try number to keep track of the attempts.*/
30381  }
30382  }
30383  }
30384  }
30385  if
30386  (
30387  MAN.trynumber == 0x07U
30388  ) /* If we have tried three times to communicate with a PerfSwitch,*/
30389  {
30390  ((int)(bitmapstruct.element5 |= (1 << 28))); /* 1 */
30391  {
30392  CMD.sw_status_bit_check = true ;/* Reset the flag if needed.*/
30393  Generate_Sine_Wave_Data ( 1.0 ) ;/* Adjust the FSK data spacing to its original value.*/
30394  Set_Status ( 8 ) ;/* Set the status bit to show we did not communicate with a PerfSwitch.*/
30395  Prepare_Return_B ( MAN.msg ) ;/* Prepare message to show it did not communicate.*/
30396  Clear_Status ( 8 ) ;/* Clear the status bit for the next message.*/
30397  Clear_Status ( 12 ) ;/* Clear the 12th Status bit for the next message.*/
30398  MAN.error = false ;/* Reset flag so command response can complete.*/
30399  }
30400  } else ((int)(bitmapstruct.element5 |= (1 << 29))); /* 4 */
30401  }
30402  ((int)(bitmapstruct.element5 |= (1 << 30))); /* 3 */
30403  }
30404  else
30405  {
30406  ((int)(bitmapstruct.element5 |= (1 << 31))); /* 2 */
30407  {
30408  switch (
30409  ( ( int )( /* 29 */
30410  MAN.trynumber
30411  ))*
30412  ((bitmapstruct.element6 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ) /* 19 */
30413  ) /* Adjust the FSK frequency based on which attempt it is and retry.*/
30414  {
30415  case 0x02U :
30416  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
30417  /* This will be the second try to send a message to a PerfSwitch.*/
30418  {
30419  MAN.error = true ; /* Set flag to show there was an error in the Manchester response.*/
30420  Generate_Sine_Wave_Data ( 1.00 ) ; /* Adjust the FSK data spacing to the initial value.*/
30421  DWNMSG.xmit_ready_flag = MAN.trynumber ; /* Flag to start another FSK transmission to PerfSwitch.*/
30422  MAN.trynumber = 0x03U ; /* Increment the attempt counter.*/
30423  }
30424  ((int)(bitmapstruct.element6 |= (1 << 2))); /* 16 */
30425  goto l129970 ;
30426  case 0x03U :
30427  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ); /* 41 */
30428  /* This will be the third try to send a message to a PerfSwitch.*/
30429  {
30430  MAN.error = true ; /* Set flag to show there was an error in the Manchester response.*/
30431  Generate_Sine_Wave_Data ( 1.07 ) ; /* Adjust the FSK data spacing 7% slower assuming the PerfSwitches are hotter.*/
30432  DWNMSG.xmit_ready_flag = MAN.trynumber ; /* Flag to start another FSK transmission to PerfSwitch.*/
30433  MAN.trynumber = 0x04U ; /* Increment the attempt counter.*/
30434  }
30435  ((int)(bitmapstruct.element6 |= (1 << 4))); /* 16 */
30436  goto l129970 ;
30437  case 0x04U :
30438  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ); /* 41 */
30439  /* This will be the third try to send a message to a PerfSwitch.*/
30440  {
30441  MAN.error = true ; /* Set flag to show there was an error in the Manchester response.*/
30442  Generate_Sine_Wave_Data ( 0.95 ) ; /* Adjust the FSK data spacing 5% faster assuming the PerfSwitches are colder.*/
30443  DWNMSG.xmit_ready_flag = MAN.trynumber ; /* Flag to start another FSK transmission to PerfSwitch.*/
30444  MAN.trynumber = 0x05U ; /* Increment the attempt counter.*/
30445  }
30446  ((int)(bitmapstruct.element6 |= (1 << 6))); /* 16 */
30447  goto l129970 ;
30448  case 0x05U :
30449  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
30450  /* No more tries to communicate with a PerfSwitch.*/
30451  {
30452  CMD.sw_status_bit_check = true ; /* Reset the flag if needed.*/
30453  Generate_Sine_Wave_Data ( 1.0 ) ; /* Adjust the FSK data spacing to its original value.*/
30454  Set_Status ( 13 ) ; /* Set the status bit to show we did not communicate with a PerfSwitch.*/
30455  Prepare_Return_B ( MAN.msg ) ; /* Prepare message to show it did not communicate.*/
30456  Clear_Status ( 13 ) ;/* Clear the status bit for the next message.*/
30457  Clear_Status ( 12 ) ;/* Clear the 12th Status bit for the next message.*/
30458  MAN.error = false ; /* Reset flag so command response can complete.*/
30459  }
30460  ((int)(bitmapstruct.element6 |= (1 << 8))); /* 16 */
30461  goto l129970 ;
30462  default :
30463  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
30464  {
30465  MAN.trynumber = 0x02U ; /* Default try number.*/
30466  }
30467  ((int)(bitmapstruct.element6 |= (1 << 10))); /* 16 */
30468  goto l129970 ;
30469  }
30470 l129970 :
30471  ; /* 18 */
30472  }
30473  }
30474  ((int)(bitmapstruct.element6 |= (1 << 11))); /* 30 */
30475  man_59zqendz ( 204 ) ; /* 30 */
30476  }
30477 /*!*************************************************************************************
30478  Function:
30479  static void Flush_Buffer_Manchester( void )
30480  Summary:
30481  Function to reset MAN.level[], MAN.TIME[], MAN.msg[] and MAN.PREAMBLE[] buffers.
30482  Remarks:
30483  Refer to the man.h interface header for function usage details.
30484  */
30485 
30486 static void
30488  {
30489  int izzqqzz=((int)(bitmapstruct.element6 |= (1 << 12))); /* 37 */
30490  ( void ) memset ( MAN.time , 0 , 96 ) ;
30491  ( void ) memset ( MAN.level , 0 , 96 ) ;
30492  ( void ) memset ( MAN.msg , 0 , 4 ) ;
30493  ( void ) memset ( MAN.preamble , 0 , 5 ) ;
30494  ((int)(bitmapstruct.element6 |= (1 << 13))); /* 30 */
30495  man_59zqendz ( 206 ) ; /* 30 */
30496  }
30497 /*!*************************************************************************************
30498  Function:
30499  float32_t CalcFskScaling(void)
30500  Summary:
30501  Function to calculate the amount of FSK adjust based on the preamble bit timer
30502  counts.
30503  Remarks:
30504  Refer to the man.h interface header for function usage details.
30505  */
30506 
30507 static float32_t
30509  {
30510  int izzqqzz=((int)(bitmapstruct.element6 |= (1 << 14))); /* 37 */
30511  float32_t
30512  fsk_adjust ;
30514  /* LDRA_INSPECTED 444 S
30515 */ /* Value cast to float.*/
30516  fsk_adjust = ( float32_t ) (
30517  ( MAN.preamble[ 1 ] + MAN.preamble[ 2 ] + MAN.preamble[ 3 ] + /* This calculates the average number of timer counts for the */
30518  MAN.preamble[ 4 ] ) /
30519  2U ) ; /* preamble.*/
30520  if
30521  ( /* 50 */
30522  (
30523 
30524  ( /* 52 */
30525  (
30526  FSK.fsk_timer_freq > 0.0F
30527  )
30528  ? (bitmapstruct.element6 |= (1 << 15 ), 1)
30529  : (bitmapstruct.element6 |= (1 << 16 ), 0) ) /* 54 */
30530  &&
30531  ( FSK.baud > 0.0F )
30532  ) /* Ensure the denominators are not zero,(MISRA)*/
30533  ) /* 1 */
30534  {
30535  ((int)(bitmapstruct.element6 |= (1 << 17))); /* 1 */
30536  {
30537  fsk_adjust = fsk_adjust /
30538  ( FSK.fsk_timer_freq /
30539  FSK.baud ) ; /* Calculate a percentage change for the FSK adjustment.*/
30540  }
30541  } else ((int)(bitmapstruct.element6 |= (1 << 18))); /* 4 */
30542  ((int)(bitmapstruct.element6 |= (1 << 19))); /* 30 */
30543  man_59zqendz ( 212 ) ; /* 30 */
30544  return
30545  fsk_adjust ;
30546  }
30547 /*!*************************************************************************************
30548  Function:
30549  void CalcAutoBias( void )
30550  Summary:
30551  Function to calculate the amount of bias adjust required and to transmit that
30552  result via a SPI port to the Manchester bias DAC.
30553  Remarks:
30554  Refer to the man.h interface header for function usage details.
30555  */
30556 
30557 void
30559  {
30560  int izzqqzz=((int)(bitmapstruct.element6 |= (1 << 20))); /* 37 */
30561  /* MAN_BIAS.ADJ[0] = (uint8_t)(25.1 * ((MAN_BIAS.SLOPE * WL_CPS.CURRENT) + MAN_BIAS.OFFSET))*/
30562  MAN_BIAS.index = ( uint8_t ) (
30563  ( WL_CPS.current >> 1 ) + 2U ) ; /* Determine the man bias table index needed.*/
30564  if
30565  (
30566  MAN_BIAS.index > ( 48U - 1U )
30567  ) /* If the result is greater than the number of values in the table,*/
30568  {
30569  ((int)(bitmapstruct.element6 |= (1 << 21))); /* 1 */
30570  {
30571  MAN_BIAS.index = ( 48U - 1U ) ; /* set the index to the maximum value.*/
30572  }
30573  } else ((int)(bitmapstruct.element6 |= (1 << 22))); /* 4 */
30574  MAN_BIAS.adj[ 0 ] = MAN_BIAS.dac_a_setting | ( biasval[ MAN_BIAS.index ] & 0x00FFU ) ;/* Configure the SPI data to write to the DAC A only.*/
30575  MAN_BIAS.bufferHandle = DRV_SPI_BufferAddWrite2 ( MAN_BIAS.spi_bias_fsk ,/* Command to send the data out of the SPI port.*/
30576  & MAN_BIAS.adj , sizeof ( MAN_BIAS.adj ) ,
30578  ((int)(bitmapstruct.element6 |= (1 << 23))); /* 30 */
30579  man_59zqendz ( 216 ) ; /* 30 */
30580  }
30581 /*!*************************************************************************************
30582  Function:
30583  void Set_Bias(uint8_t value)
30584  Summary:
30585  Function to transmit the bias adjust value via an SPI port to the Manchester
30586  bias DAC. Value is integer between 0 and 47.
30587  Remarks:
30588  Refer to the man.h interface header for function usage details.
30589  */
30590 
30591 void
30593  uint8_t value )
30594  {
30595  int izzqqzz=((int)(bitmapstruct.element6 |= (1 << 24))); /* 37 */
30596  uint8_t
30597  bias_index ;
30598  bias_index = value ;
30599 /* value = ((value < 0U) ? 0U : (value > 47U) ? 47U : value)*/ /* Ensure value is within usable range and correct for biasval table.*/
30600  /* The biasval table provides predetermined DAC settings for desired voltages.*/
30601  if
30602  (
30603  bias_index > 47U
30604  ) /* Ensure value is within usable range and correct for biasval table.*/
30605  {
30606  ((int)(bitmapstruct.element6 |= (1 << 25))); /* 1 */
30607  {
30608  bias_index = 47U ;
30609  }
30610  } else ((int)(bitmapstruct.element6 |= (1 << 26))); /* 4 */
30611  MAN_BIAS.adj[ 0 ] = MAN_BIAS.dac_a_setting | ( biasval[ bias_index ] & 0x00FFU ) ;/* Configure the SPI data to write to the DAC A only.*/
30612  MAN_BIAS.bufferHandle = DRV_SPI_BufferAddWrite2 ( MAN_BIAS.spi_bias_fsk ,/* Command to send the data out of the SPI port.*/
30613  & MAN_BIAS.adj , sizeof ( MAN_BIAS.adj ) ,
30615  ((int)(bitmapstruct.element6 |= (1 << 27))); /* 30 */
30616  man_59zqendz ( 220 ) ; /* 30 */
30617  }
30618 /***************************************************************************************
30619  End of File
30620  */
30621 #define qqqbranches 220
30622 #define QQQMAXMCDCSIZE 2
30623 /********************** LDRA_PORT INSTRUMENTATION **********************/
30624 
30625 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
30626 #define ldra_sscanf
30627  /* put in undefs to protect our parameter names from macros */
30628 #undef f
30629 #undef i
30630 #undef j
30631 #undef k
30632 #undef s
30633 #undef l
30634 #undef ii
30635 #undef some
30636 #undef none
30637 #undef from
30638 #undef a
30639 #undef b
30640 #undef iz
30641 #undef jz
30642 #undef qqnull_params
30643 #define qqnull_params void
30644  /* Conventional Instrumentation */
30645 #define qqzzidfield 1
30646  /* single file or fileid */
30647  /* these have an extra field for the fileid */
30648  static char qqqqone[] = "%6d\n"; /* single point */
30649  /* uncompressed data structures */
30650  /* uncompressed bitmap */
30651 #define QQQFIXEDSIZE
30652  static int qqqlast = 0;
30653  extern int qqupload_registered;
30654  extern int man_59zqqzqz(qqnull_params);
30655  extern int man_59zqqzqz1(qqnull_params);
30656  /* ----------------------------------------------------------------------* 200 *
30657  * Procedures
30658  * -----------------------------------------------------------------------------
30659  */
30660  /* ----------- zscanf ---------------------------------------------------* 201 *
30661  * Returns an integer extracted from a string
30662  * -----------------------------------------------------------------------------
30663  */
30664  static int man_59zscanf(char * qqscan_str)
30665  {
30666  int qqvalue;
30667  int qqisign;
30668  char * qqcptr;
30669  qqvalue = 0;
30670  qqisign = 1;
30671  qqcptr = qqscan_str;
30672  /* Skip spaces */
30673  while (qqcptr[0] == ' ')
30674  {
30675  qqcptr++;
30676  }
30677  /* Check for a leading ---
30678  */
30679  if (qqcptr[0] == '-')
30680  {
30681  qqisign = -1;
30682  qqcptr++;
30683  }
30684  /* Extract digits */
30685  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
30686  {
30687  qqvalue = 10 * qqvalue;
30688  qqvalue = qqvalue + (qqcptr[0] - '0');
30689  qqcptr++;
30690  }
30691  qqvalue = qqisign * qqvalue;
30692  return qqvalue;
30693  } /* end of zscanf */
30694  /* ----------------------------------------------------------------------* 210 *
30695  * C System utilities in use:
30696  * fprintf
30697  * fclose
30698  * sscanf
30699  * -----------------------------------------------------------------------------
30700  */
30701  /* ----------------------------------------------------------------------* 213 *
30702  * qqoutput* suite
30703  * Main output routines. These may require modification.
30704  * -----------------------------------------------------------------------------
30705  */
30706  /* ----------------------------------------------------------------------* 214 *
30707  * qqoutput
30708  * This is the principle output routine.
30709  * -----------------------------------------------------------------------------
30710  */
30711  static void qqoutput(FILEPOINT char * s,int i)
30712  /* f - file pointer, s - format string, i - integer for probe value */
30713  {
30714  /* printing to a file */
30715  /* fprintf exists, not threaded */
30716  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
30717  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
30718  ldra_port_write (&ldra_buffer[0]);
30719  } /* end of qqoutput */
30720  /* ----------------------------------------------------------------------* 215 *
30721  * qqoutput0
30722  * -----------------------------------------------------------------------------
30723  */
30724  static void qqoutput0(FILEPOINT char * s)
30725  {
30726  ldra_port_write(s);
30727  } /* end of qqoutput0 */
30728  /* ----------------------------------------------------------------------* 216 *
30729  * qqoutput2
30730  * -----------------------------------------------------------------------------
30731  */
30732  static void qqoutput2(FILEPOINT char * s,int i, int j)
30733  {
30734  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
30735  ldra_port_write (&ldra_buffer[0]);
30736  } /* end of qqoutput2 */
30737  /* ----------------------------------------------------------------------* 217 *
30738  * qqoutput3
30739  * -----------------------------------------------------------------------------
30740  */
30741  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
30742  {
30743  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
30744  ldra_port_write (&ldra_buffer[0]);
30745  } /* end of qqoutput3 */
30746  /* ----------------------------------------------------------------------* 218 *
30747  * qqoutput4
30748  * -----------------------------------------------------------------------------
30749  */
30750  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
30751  {
30752  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
30753  ldra_port_write (&ldra_buffer[0]);
30754  } /* end of qqoutput4 */
30755  /* ----------------------------------------------------------------------* 219 *
30756  * end of qqoutput* suite
30757  * -----------------------------------------------------------------------------
30758  */
30759  /* ----------------------------------------------------------------------* 222 *
30760  * qqqqinitialise
30761  * This procedure initialises the structures for
30762  * compressed execution histories.
30763  * -----------------------------------------------------------------------------
30764  */
30765  static void qqqqinitialise(int ii)
30766  {
30767  unsigned int i;
30768  /* First time through. */
30769  /* bitmap */
30770  /* bitmap separate */
30771  qqqlast = 1; /* stops qqfun() calling initialise again */
30772  /* bitmap */
30773  /* bitmap singlefile */
30774  /* struct singlefile notmainfl */
30775  } /* end of qqqqinitialise */
30776 /* ----------------------------------------------------------------------* 225 *
30777 * qqqbitmapreset
30778 * This procedure resets the structures for
30779 * compressed execution histories.
30780 * -----------------------------------------------------------------------------
30781 */
30782 static void qqqbitmapreset()
30783 {
30784 struct bitmapstruct_t localbitmap = {0};
30785 bitmapstruct = localbitmap;
30786 } /* end of qqqbitmapreset */
30787 #undef QQQTEMP1
30788 #define QQQTEMP1
30789  /* ----------- zqqzqz ---------------------------------------------------* 310 *
30790  * -----------------------------------------------------------------------------
30791  */
30792  /* ----------------------------------------------------------------------* 312 *
30793  * This routine opens the execution history file. It is instrumented at the
30794  * start of the main program if one exists in the file. In general this is
30795  * superceded by man_59zqqzqz1 below.
30796  * -----------------------------------------------------------------------------
30797  */
30799  {
30800  if ( man_59zzopen != 1 )
30801  {
30802 #undef QQQMUSTOPEN
30803  man_59zzopen = 1;
30804  }
30805  return(1);
30806  } /* end of zqqzqz */
30807  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
30808  * -----------------------------------------------------------------------------
30809  */
30810  /* ----------------------------------------------------------------------* 317 *
30811  * This routine also opens the execution history file. It is called
30812  * automatically if a probe fires and the execution history is not already
30813  * opened (man_59zzopen = 0 ).
30814  * Because this always works ( it was intended for files with no main program
30815  * it is now the de facto common way to open the execution history.
30816  * -----------------------------------------------------------------------------
30817  */
30819  {
30820  if ( man_59zzopen != 1 )
30821  {
30822  ldra_port_open(); /* 7 */
30823  qqqqinitialise(0);
30824  man_59zzopen = 1;
30825  }
30826  return(1);
30827  } /* end of zqqzqz1 */
30828  /* ----------- zqendz ---------------------------------------------------* 330 *
30829  * This routine is called on exiting a routine in a
30830  * module. It closes the execution history.
30831  * -----------------------------------------------------------------------------
30832  */
30833 static int man_59zqendz(int qqqi)
30834  {
30835  if (!qqqstructzzopen)
30836  {
30838  qqqstructzzopen = 1;
30839  }
30840  if ( man_59zzopen != 1 )
30841  {
30842  man_59zqqzqz1();
30843  }
30844  /* ----------------------------------------------------------------------* 331 *
30845  * this is the one which puts an integer into
30846  * the execution history file and returns unity.
30847  * The format of each field consists of six columns,
30848  * the number is right justified in this field.
30849  * -----------------------------------------------------------------------------
30850  */
30851  if ( man_59zzopen )
30852  {
30853  /* uncompressed */
30854  /* uncompressed unbuffered */
30855  /* uncompressed unbuffered bitmap */
30856  if ( qqqi > 0 )
30857  {
30858  }
30859  else
30860  {
30861  }
30862  }
30863  qqqlast = 0;
30864  return(1);
30865  } /* end of zqendz */
30866  /* ----------------------------------------------------------------------* 335 *
30867  * Output structure - qqbmsoutput
30868  * -----------------------------------------------------------------------------
30869  */
30870  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
30871  {
30872  static int branches_printed = 0;
30873  int b, last = 0;
30874  for(b=0;b<qqqqbmselwidth/8;b++)
30875  {
30876  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
30877  ldra_port_write (&ldra_buffer[0]);
30878  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
30879  ldra_port_write (&ldra_buffer[0]);
30880  last += 8;
30881  branches_printed += 8;
30882  if (branches_printed >= qqqbranches)
30883  {
30884  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
30885  break;
30886  }
30887  }
30888  }
30889  /* ----------------------------------------------------------------------* 336 *
30890  * qqqupload
30891  * This routine loops through the stored bitmap and
30892  * outputs it. It then uploads the stored mcdc.
30893  * -----------------------------------------------------------------------------
30894  */
30895  static void qqqupload(qqnull_params)
30896  {
30897  int i;
30898  /* uncompressed bitmap (!singlefile or mainfl) separate */
30899  {
30900  man_59zqqzqz1();
30901 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
30902 #define LASTELEMENT
30903 #include "man_59zbelem.def"
30904 #undef LASTELEMENT
30905 #undef ELEMENT
30906  }
30907  /* bitmap separate */
30908  qqqlast = 1; /* stops qqfun() calling initialise again */
30909  } /* end of qqqupload */
30910  /* ----------- zqzqzq ---------------------------------------------------* 342 *
30911  * -----------------------------------------------------------------------------
30912  */
30913  /* ----------------------------------------------------------------------* 344 *
30914  * This routine should be called before the program
30915  * terminates. It closes the execution history
30916  * -----------------------------------------------------------------------------
30917  */
30918  static int man_59zqzqzq(int qqqi)
30919  {
30920  if ( man_59zzopen != 1 )
30921  {
30922  man_59zqqzqz1();
30923  }
30924  /* not compressed */
30925  /* do nothing for bitmap*/
30926  /* upload the history */
30927  /* bitmap */
30928  /* uncompressed bitmap */
30929  man_59zqendz(qqqi);
30930  /* qqqupload closes the execution history file */
30931  return(1);
30932  } /* end of zqzqzq */
30933  /* the following routines should be left alone */
30934 /* END OF TESTBED INSTRUMENTATION */
30935 
bool GetDepthStatus(void)
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
TIMER_STATES
Definition: inszt_man.c:29040
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
void Calc_Auto_Bias(void)
Definition: inszt_man.c:30558
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
SYSTEM_OBJECTS sysObj
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
DRV_ADC_MODULE_ID
Definition: inszt_man.c:1425
void DRV_TMR_Close(DRV_HANDLE handle)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool DRV_USART0_TransmitBufferIsFull(void)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
PREAMBLE_STATES
Definition: inszt_man.c:28468
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void DRV_TMR3_Tasks(void)
Definition: inszt_man.c:4031
COMMAND_STATES
Definition: commands.h:62
float float32_t
Definition: inszt_man.c:27641
static void Init_Manchester(void)
Definition: inszt_man.c:30054
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR0_PeriodValueSet(uint32_t value)
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
void DRV_TMR3_Initialize(void)
void DRV_TMR2_CounterClear(void)
bool DRV_SPIn_ReceiverBufferIsFull(void)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
void DRV_IC_Stop(DRV_HANDLE handle)
void WL_CPS_Tasks(void)
void DRV_TMR3_PeriodValueSet(uint32_t value)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
SYS_STATUS DRV_USART0_Status(void)
static const uint8_t Xmit00[168]
Definition: inszt_man.c:28513
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
Definition: inszt_man.c:3871
static int man_59zqzqzq(int qqqi)
Definition: inszt_man.c:30918
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
static void DRV_TMR3_Open(void)
Definition: inszt_man.c:3970
DRV_USART_OPERATION_MODE
Definition: inszt_man.c:14975
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
bool DRV_SPIn_TransmitterBufferIsFull(void)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
float32_t hi_volts
Definition: inszt_app.c:29454
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
void DRV_USART0_TasksTransmit(void)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
float float32_t
Definition: cf.h:50
uint32_t DRV_TMR0_PeriodValueGet(void)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
static SYS_STATUS DRV_TMR1_Status(void)
Definition: inszt_man.c:3739
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_man.c:26431
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void Execute_Protocol_B(void)
void DRV_PMP0_Initialize(void)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
static uint32_t man_timer_count[100]
Definition: inszt_man.c:29588
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
int qqupload_registered
Definition: inszt_main.c:6760
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
float32_t slope
Definition: inszt_app.c:29455
uint8_t DRV_PMP0_Read(void)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
#define qqqbranches
Definition: inszt_man.c:30621
bool bad_crc
Definition: inszt_app.c:29423
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
void DRV_TMR1_StopInIdleEnable(void)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
static void Execute_System(void)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
Definition: inszt_man.c:1844
static void DRV_TMR2_Close(void)
Definition: inszt_man.c:3881
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
static int QQQfirstmcdc
Definition: inszt_man.c:81
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
MAN_RX_STATES Rx_state
Definition: inszt_app.c:29408
void DRV_ADC1_Close(void)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
static int man_59zqqzqz(qqnull_params)
Definition: inszt_man.c:30798
void PLIB_USART_Disable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR3_DeInitialize(void)
Definition: inszt_man.c:3950
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
DRV_SPI_TASK_MODE
Definition: inszt_man.c:26360
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
Definition: inszt_man.c:3651
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
float32_t hi_current
Definition: inszt_app.c:29451
void DRV_TMR1_Stop(void)
static void DRV_TMR2_Tasks(void)
Definition: inszt_man.c:3921
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
void DRV_IC0_Start(void)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
void DRV_USART0_TasksError(void)
static void DRV_TMR4_Tasks(void)
Definition: inszt_man.c:4141
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
#define man_59zzopen
Definition: inszt_man.c:82
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
void DRV_TMR0_Initialize(void)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void DRV_ADC0_Close(void)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
void SYS_DEBUG_Message(const char *message)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
DRV_USART_BUFFER_RESULT
Definition: inszt_man.c:15034
uint16_t DRV_IC0_Capture16BitDataRead(void)
static SYS_STATUS DRV_TMR0_Status(void)
Definition: inszt_man.c:3629
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
uint8_t table_count
Definition: fsk.h:92
static SYS_STATUS DRV_TMR4_Status(void)
Definition: inszt_man.c:4069
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
void Set_Status(uint8_t bitposn)
uint8_t Get_CRC_Value(void)
Definition: crc.c:157
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
void DRV_TMR2_PeriodValueSet(uint32_t value)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_man.c:21780
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
uint8_t level[96]
Definition: inszt_app.c:29412
uint32_t DRV_TMR1_PeriodValueGet(void)
DRV_USART_BUFFER_EVENT
Definition: inszt_man.c:15012
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_man.c:15380
MAN_PROCESS_STATES
Definition: inszt_app.c:29386
static void Send_Mark(void)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
void FSK_Tasks(void)
Definition: fsk.c:104
static char qqqqone[]
Definition: inszt_man.c:30648
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
float32_t baud
Definition: fsk.h:86
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR4_Close(void)
Definition: inszt_man.c:4101
uint8_t ans[32U+2]
Definition: inszt_app.c:29413
void DRV_IC0_Initialize(void)
void DRV_ADC0_Open(void)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
MAN_BIAS_DATA MAN_BIAS
Definition: inszt_man.c:29570
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
float32_t lo_current
Definition: inszt_app.c:29452
static int qqqisinitialised
Definition: inszt_main.c:152
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
uint16_t time[96]
Definition: inszt_app.c:29411
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
DRV_SPI_BUFFER_TYPE
Definition: inszt_man.c:26260
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_man.c:26163
#define man_59zqqzqz1
Definition: inszt_man.c:84
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
PRE_DATA PRE_MSG
Definition: fsk.c:73
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR0_Open(void)
Definition: inszt_man.c:3640
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
static void Test_Manchester(void)
Definition: inszt_man.c:30286
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
static void DRV_TMR2_Open(void)
Definition: inszt_man.c:3860
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
void MAN_RX_Tasks(void)
Definition: inszt_man.c:29829
bool DepthStatus
Definition: commands.c:204
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void DRV_TMR1_DeInitialize(void)
Definition: inszt_man.c:3730
void PLIB_SPI_Enable(SPI_MODULE_ID index)
#define FILEPOINT
Definition: inszt_man.c:97
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
static MAN_STATES M_STATES
Definition: inszt_man.c:29576
DRV_CLIENT_STATUS
Definition: inszt_man.c:935
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
DRV_USART_INIT_FLAGS
Definition: inszt_man.c:15280
void DRV_ADC_Stop(void)
void DRV_SPI_Close(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
SYS_DMA_DATA_WIDTH
Definition: inszt_man.c:13438
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
Definition: fsk.h:123
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
void DRV_TMR3_Stop(void)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
uint8_t Calc_CRC_Array(uint16_t Count, const uint8_t Bytes [])
Definition: crc.c:92
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
static int tbrun_mode
Definition: inszt_man.c:102
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
DRV_IO_BUFFER_TYPES
Definition: inszt_man.c:992
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
DOWN_MSG DWNMSG
Definition: fsk.c:69
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
static void Execute_Protocol_A(void)
WL_CPS_STATES
Definition: inszt_app.c:28620
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
static void qqoutput0(FILEPOINT char *s)
Definition: inszt_man.c:30724
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
static void DRV_TMR4_DeInitialize(void)
Definition: inszt_man.c:4060
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
void MAN_Tasks(void)
Definition: inszt_man.c:29645
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
static void DRV_TMR1_Close(void)
Definition: inszt_man.c:3771
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
void DRV_PMP0_ModeConfig(void)
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
DRV_SPI_CLOCK_MODE
Definition: inszt_man.c:26215
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
void DRV_TMR3_CounterClear(void)
bool spi_write_complete_flag
Definition: inszt_app.c:29418
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
FSK_STATES
Definition: inszt_man.c:28344
uint32_t baudRate
Definition: inszt_adc.c:26572
uint8_t crc
Definition: inszt_app.c:29426
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
Definition: inszt_man.c:30870
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
static MAN_PROCESS_STATES MTX_STATES
Definition: inszt_man.c:29582
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
static SYS_STATUS DRV_TMR3_Status(void)
Definition: inszt_man.c:3959
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
unsigned char uchar8_t
Definition: commands.h:52
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
float32_t TABLE_MOD[50]
Definition: fsk.h:91
uint32_t DRV_TMR1_CounterFrequencyGet(void)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_man.c:13274
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
static int man_59zqendz(int qqqi)
Definition: inszt_man.c:30833
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
void DRV_TMR1_Initialize(void)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
void DRV_PMP0_Write(uint8_t data)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
static void qqoutput(FILEPOINT char *s, int i)
Definition: inszt_man.c:30711
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
static void DRV_TMR0_Tasks(void)
Definition: inszt_man.c:3701
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
float32_t offset
Definition: inszt_app.c:29456
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
float32_t lo_volts
Definition: inszt_app.c:29453
static void Send_Space(void)
void DRV_TMR4_StopInIdleDisable(void)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
MAN_PROCESS_STATES
Definition: inszt_man.c:27688
WL_CPS_DATA WL_CPS
Definition: wl_cps.c:56
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_man.c:13165
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR4_Stop(void)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART_Close(const DRV_HANDLE handle)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
bool Valid_Command(uchar8_t msg)
Definition: commands.c:1111
static int qqqqbmselwidth
Definition: inszt_man.c:54
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
FSK_DATA FSK
Definition: fsk.c:71
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
static unsigned char qqqzzglobflag
Definition: inszt_man.c:172
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
void APP_Initialize(void)
Definition: app.c:93
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
Definition: inszt_man.c:3761
void DRV_TMR_Stop(DRV_HANDLE handle)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
#define DRV_IC_Open(drvIndex, intent)
Definition: inszt_man.c:1333
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
DRV_IO_INTENT
Definition: inszt_adc.c:975
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
bool DRV_TMR_Start(DRV_HANDLE handle)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
static void DRV_TMR0_Close(void)
Definition: inszt_man.c:3661
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool SYS_DMA_IsBusy(void)
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
void(* ldra_void_function)()
Definition: inszt_man.c:120
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_man.c:21819
uint32_t DRV_TMR3_CounterValueGet(void)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
Definition: fsk.h:170
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
Definition: inszt_man.c:30750
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
static bool Check_Manchester(void)
Definition: inszt_man.c:30238
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
void Prepare_Return_B(uint8_t byt [])
MSG_STATES
Definition: inszt_man.c:28428
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
uint32_t DRV_TMR0_CounterValueGet(void)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
void DRV_TMR3_CounterValueSet(uint32_t value)
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
MAN_STATES
Definition: inszt_app.c:29350
Definition: fsk.h:217
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
DRV_HANDLE spi_bias_fsk
Definition: inszt_app.c:29445
uint8_t index
Definition: inszt_app.c:29457
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
COMMAND_DATA CMD
Definition: commands.c:196
static void qqqbitmapreset(qqnull_params)
DRV_SPI_BUFFER_HANDLE bufferHandle2
Definition: inszt_app.c:29447
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
void DRV_TMR3_StopInIdleDisable(void)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
MAN_STATES
Definition: inszt_man.c:27652
struct _DRV_SPI_INIT DRV_SPI_INIT
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
bool process_complete_flag
Definition: inszt_app.c:29417
static void MAN_PROCESS_Tasks(void)
Definition: inszt_man.c:29979
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
void SYS_DEBUG_Print(const char *format,...)
uint16_t dac_b_setting
Definition: inszt_app.c:29450
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
Definition: fsk.h:78
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
static void Send_Message_Tasks(void)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
static MAN_RX_STATES MRX_STATES
Definition: inszt_man.c:29579
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_man.c:13385
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
void DRV_TMR2_Stop(void)
SYS_DMA_ERROR
Definition: inszt_man.c:13407
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
static void DRV_TMR4_Open(void)
Definition: inszt_man.c:4080
uint16_t current
Definition: inszt_app.c:28641
uint8_t Calc_CRC_Uplink(uint16_t Count, const uint8_t Bytes [])
Definition: crc.c:116
uint8_t trynumber
Definition: inszt_app.c:29416
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
DRV_TMR_OPERATION_MODE
Definition: inszt_man.c:1764
void PLIB_USART_Enable(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
uint32_t DRV_TMR2_PeriodValueGet(void)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
uint32_t DRV_TMR4_PeriodValueGet(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
bool DRV_TMR4_Start(void)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
void DRV_TMR1_StopInIdleDisable(void)
APP_DATA APP
Definition: app.c:73
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
static void Init_WL_CPS(void)
void Generate_Sine_Wave_Data(float32_t NoOfTicks)
Definition: fsk.c:501
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
Definition: inszt_man.c:15112
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
void DRV_ADC_DeInitialize(void)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
static int qqqstructzzopen
Definition: inszt_man.c:142
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
void COMMAND_Tasks(void)
Definition: commands.c:225
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_IC0_Capture32BitDataRead(void)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
MSG_DATA MSG
Definition: fsk.c:72
DRV_TMR_CLK_SOURCES
Definition: inszt_man.c:1610
void DRV_IC0_Stop(void)
bool spi_sent_flag
Definition: inszt_app.c:29419
SYS_PORTS_PIN_DIRECTION
Definition: inszt_man.c:21804
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
uint16_t PORTS_DATA_MASK
Definition: inszt_man.c:18435
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
#define DRV_IC_Close(handle)
Definition: inszt_man.c:1334
static void DRV_TMR2_DeInitialize(void)
Definition: inszt_man.c:3840
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
static int man_59zscanf(char *qqscan_str)
Definition: inszt_man.c:30664
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
static SYS_STATUS DRV_TMR2_Status(void)
Definition: inszt_man.c:3849
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
static void Init_FSK(void)
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_ERROR
Definition: inszt_adc.c:15426
MAN_STATES state
Definition: inszt_app.c:29407
void DRV_TMR4_PeriodValueSet(uint32_t value)
bool tick
Definition: inszt_app.c:29422
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
uint8_t queueSize
Definition: inszt_adc.c:26592
MAN_DATA MAN
Definition: inszt_man.c:29573
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
void DRV_TMR4_CounterValueSet(uint32_t value)
int qqqshell_upload
Definition: inszt_main.c:150
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
void DRV_TMR4_CounterClear(void)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
void DRV_ADC1_Open(void)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
uint32_t SYS_DMA_ChannelCRCGet(void)
void Set_Bias(uint8_t value)
Definition: inszt_man.c:30592
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
Definition: inszt_man.c:30741
static struct bitmapstruct_t bitmapstruct
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
void DRV_TMR0_CounterValueSet(uint32_t value)
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
bool DRV_TMR3_Start(void)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
static const uint8_t Xmit11[312]
Definition: inszt_man.c:28499
static void qqoutput2(FILEPOINT char *s, int i, int j)
Definition: inszt_man.c:30732
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_man.c:13251
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t DRV_USART0_ReadByte(void)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_SIDL
Definition: inszt_man.c:13191
DRV_USART_BAUD_SET_RESULT
Definition: inszt_man.c:15182
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART0_Close(void)
DRV_USART_LINE_CONTROL
Definition: inszt_man.c:15231
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
unsigned char uchar8_t
Definition: inszt_man.c:28146
COMMAND_STATES
Definition: inszt_man.c:29163
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
static void Read_WL_CPS_V_I(void)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_man.c:26283
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
Definition: inszt_man.c:4091
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void Prepare_Dwn_Msg(uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length)
Definition: fsk.c:227
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static void Check_WL_CPS_Over_Current(void)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
void DRV_ADC_Initialize(void)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
Definition: inszt_man.c:13545
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
void Calc_CRC(uint16_t nbits, uint8_t thebits)
Definition: crc.c:55
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
uint16_t dac_a_setting
Definition: inszt_app.c:29449
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
static void Flush_Buffer_Manchester(void)
Definition: inszt_man.c:30487
void DRV_TMR4_Initialize(void)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
uint32_t DRV_TMR4_CounterValueGet(void)
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
static int qqqlast
Definition: inszt_man.c:30652
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
DRV_SPI_BUFFER_EVENT
Definition: inszt_man.c:26315
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
uint16_t adj[1]
Definition: inszt_app.c:29448
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
SYS_ERROR_LEVEL gblErrLvl
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
uint16_t preamble[5]
Definition: inszt_app.c:29410
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
void Clear_Status(uint8_t bitposn)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
PREAMBLE_STATES
Definition: fsk.h:191
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
static void DRV_TMR0_DeInitialize(void)
Definition: inszt_man.c:3620
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
MAN_PROCESS_STATES Process_state
Definition: inszt_app.c:29409
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void Adjust_WL_CPS_Voltage(uint8_t target)
static void qqqqinitialise(int ii)
Definition: inszt_man.c:30765
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
static int zzfileid
Definition: inszt_man.c:55
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
void DRV_TMR4_StopInIdleEnable(void)
static const uint8_t biasval[48U]
Definition: inszt_man.c:29600
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
bool DRV_TMR1_Start(void)
static void SPI_1_EventHandler(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_man.c:29610
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
int QQQindicator
Definition: inszt_main.c:104
uintptr_t DRV_HANDLE
Definition: inszt_man.c:1024
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_man.c:15203
static void DRV_TMR1_Tasks(void)
Definition: inszt_man.c:3811
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
static void DRV_TMR3_Close(void)
Definition: inszt_man.c:3991
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
Definition: inszt_man.c:15144
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
void DRV_TMR2_Initialize(void)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
bool error
Definition: inszt_app.c:29424
static void Decode_Manchester(void)
Definition: inszt_man.c:30107
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
SYS_ERROR_LEVEL
Definition: inszt_man.c:17464
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
void DRV_USART0_TasksReceive(void)
void DRV_USART0_Deinitialize(void)
TIMER_DATA TIMER
Definition: timers.c:64
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
Definition: app.h:59
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_TMR2_Start(void)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
bool manual_bias_flag
Definition: inszt_app.c:29425
static uint8_t fnp
Definition: inszt_man.c:29591
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
uint8_t xmit_ready_flag
Definition: fsk.h:128
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
Definition: inszt_man.c:3981
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
MSG_STATES
Definition: fsk.h:145
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
void DRV_TMR2_StopInIdleDisable(void)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
uint8_t count
Definition: inszt_man.c:29594
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
FSK_STATES state
Definition: fsk.h:80
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
MAN_RX_STATES
Definition: inszt_app.c:29370
DRV_USART_ERROR
Definition: inszt_man.c:15342
WL_CPS_STATES
Definition: inszt_man.c:28782
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void DRV_TMR2_StopInIdleEnable(void)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
uint8_t msg[4]
Definition: inszt_app.c:29414
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART0_WriteByte(const uint8_t byte)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_man.c:13297
void DRV_TMR0_CounterClear(void)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
bool sw_status_bit_check
Definition: commands.h:81
void DRV_ADC_Start(void)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
TIMER_STATES
Definition: inszt_app.c:30355
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR3_PeriodValueGet(void)
void DRV_TMR1_CounterValueSet(uint32_t value)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE bufferHandle
Definition: inszt_app.c:29446
void DRV_TMR0_StopInIdleEnable(void)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
#define QQQnumfil
Definition: inszt_man.c:56
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
#define qqnull_params
Definition: inszt_man.c:30643
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR3_StopInIdleEnable(void)
bool DRV_IC0_BufferIsEmpty(void)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
FSK_STATES
Definition: fsk.h:53
uint8_t cnt_preamble
Definition: inszt_app.c:29415
static float32_t Calc_Fsk_Scaling(void)
Definition: inszt_man.c:30508
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
void DRV_TMR2_CounterValueSet(uint32_t value)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_man.c:13232
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
void DRV_TMR0_Stop(void)
uint32_t DRV_TMR2_CounterValueGet(void)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_man.c:14951
void Set_WL_CPS_CurrentLimit(uint8_t value)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
static void Package_Manchester(void)
Definition: inszt_man.c:30183
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
void Reset_CRC_Value(void)
Definition: crc.c:141
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
static void qqqupload(qqnull_params)
Definition: inszt_man.c:30895
void TIMER_Tasks(void)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
DRV_USART_HANDSHAKE
Definition: inszt_man.c:15157
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
void DRV_TMR1_CounterClear(void)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
uint32_t PORTS_DATA_TYPE
Definition: inszt_man.c:18448
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
float32_t fsk_timer_freq
Definition: fsk.h:87
void SYS_DMA_Suspend(void)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_Initialize()
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
TMultiValue MESSAGE
Definition: fsk.c:70
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
DRV_SPI_MODE
Definition: inszt_man.c:26337
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
bool b_command_complete_flag
Definition: commands.h:80
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
void APP_Tasks(void)
Definition: app.c:130
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
MAN_RX_STATES
Definition: inszt_man.c:27672
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
static void Execute_Auto_Protocol_A(void)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_man.c:15405
static void DRV_TMR1_Open(void)
Definition: inszt_man.c:3750
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
bool DRV_TMR0_Start(void)
DRV_IO_INTENT
Definition: inszt_man.c:891
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
void DRV_TMR0_StopInIdleDisable(void)
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR1_PeriodValueSet(uint32_t value)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
SYS_DMA_CHANNEL_CHAIN_PRIO
Definition: inszt_man.c:13211
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
void SYS_DMA_Resume(void)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
uint8_t timer_complete
Definition: inszt_app.c:29421
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
uint8_t timer_count
Definition: inszt_app.c:29420
int QQQfcn_ptr_num
Definition: inszt_main.c:151
DRV_TMR_CLIENT_STATUS
Definition: inszt_man.c:1717
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
uint32_t DRV_TMR1_CounterValueGet(void)